How to set css style not

藏色散人
Release: 2023-01-04 09:35:13
Original
2342 people have browsed it

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!

Related labels:
css
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template