Home  >  Article  >  Web Front-end  >  How to set css style not

How to set css style not

藏色散人
藏色散人Original
2021-04-08 14:34:182325browse

How to set css style not: first create a new html file; then use the li tag to create a list, and set the class of the second li tag to mycss; finally, within the css tag, pass the li tag name and The ":not" selector can select li elements whose class is not mycss.

How to set css style not

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

Use the ":not" selector to define styles in css

Create a new html file, named test.html, to explain how to use ":not" in css "Selector defines style.

How to set css style not

In the test.html file, use the li tag to create a list for testing.

How to set css style not

In the test.html file, set the class of the second li tag to mycss.

How to set css style not

In the css tag, select the li element whose class is not mycss through the li tag name and the ":not" selector.

How to set css style not

In the css tag, use the color attribute to set the text color of the li element that meets the selector conditions to red.

How to set css style not

Open the test.html file in the browser to check the effect.

How to set css style not

[Recommended learning: css video tutorial]

The above is the detailed content of How to set css style not. 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