Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to write singular li in css3

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)05/31 Report--

This article introduces the relevant knowledge of "how to write singular li in css3". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

The singular li in css3 is written as "li:nth-child (odd)"; the ": nth-child" selector is used to match specified child elements that belong to its parent element. When the parameter in the selector is set to "Odd", it indicates that the matching subscript is an odd child element, where the subscript of the first child element is "1".

The operating environment of this tutorial: windows10 system, CSS3&&HTML5 version, Dell G3 computer.

What is the writing of singular li in css3

The nth-child (n) selector matches the Nth child element that belongs to its parent element, regardless of element type.

N can be a number, keyword, or formula.

Odd and even are keywords that can be used to match child elements where the subscript is odd or even (the subscript of the first child element is 1).

So it is written as follows:

Li:nth-child (odd)

Examples are as follows:

Li:nth-child (odd) {background:#ff0000;} Coffee Tea Milk

Note: Internet Explorer does not support the: nth-child () selector.

Output result:

This is the end of "how to write singular li in css3". Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report