Home>Article>Web Front-end> What is the usage of odd and even in css3

What is the usage of odd and even in css3

WBOY
WBOY Original
2022-04-28 16:02:18 6708browse

In CSS3, odd and even are used as keywords in pseudo-class selectors to select specified elements. odd represents odd elements and even represents even elements; odd and even are often used with ":nth-child(n )" selector, the syntax is "element: selector (odd or even) {css style code}".

What is the usage of odd and even in css3

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

What is the usage of odd and even in css3

odd represents an odd number and even represents an even number.

odd and even are often used to select specified elements in pseudo-class selectors.

The example is as follows:

    菜鸟教程(runoob.com)  

This is a heading

The first paragraph.

The second paragraph.

The third paragraph.

注意: Internet Explorer 8 and以及更早版本的浏览器 :nth-child()选择器.

Output result:

What is the usage of odd and even in css3

(Learning video sharing:css video tutorial)

The above is the detailed content of What is the usage of odd and even in css3. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn