In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-13 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly explains "how to select tags for css". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "how css selects tags".
Css to select the tag method: 1, the use of id selector, syntax for "# id name {css code;}"; 2, the use of class selector, syntax for ". Class name {css code;}"; 3, the use of tag selector, syntax for "* {css code;}".
The operating environment of this tutorial: windows10 system, CSS3&&HTML5 version, Dell G3 computer.
How does css select the tag?
There are four ways to select tags in css, which are also four selectors.
1. Id selector
According to the specified id name, find the corresponding unique tag in the current interface, and then set the property
# id name {attribute: value;} id selector # p1 {color: red;} # p2 {color: green;} # p3 {color: blue;} most people are handsome, floating on the surface and handsome in appearance
And EGON is not only handsome on the outside, but also handsome on the inside.
EGON is me. I'm EGON.
2. Class, class selector
According to the specified class name, find the corresponding label in the current interface, and then set the properties
. Class name {attribute: value;}
Example
Id selector .p1 {color: red;} .p2 {color: green;} .p3 {color: blue;} most people are handsome, floating on the surface, handsome in appearance
And EGON is not only handsome on the outside, but also handsome on the inside.
EGON is me. I'm EGON.
# practice the color of the first and third lines is red. The font size of the first and second lines is 50px. The second and third lines have an underlined id selector. P1 {color: red;} .p2 {font-size: 50px;} .p3 {text-decoration: underline;} first line content
The second line
The third line
3. Tag selector
Find all tags with that name in the current interface according to the specified tag name, and then set the properties
Tag name {attribute: value;}
Examples are as follows:
Tag selector p {color: red;}
EGON's beautiful appearance actually hides a restless heart.
This heart is called Qiqiao exquisite Heart. Men will cry when they eat it, while women will get pregnant after eating it.
4. Wildcard selector
Select all tags
* {attribute: value;} wildcard selector * {color: red;} I am the title, I am the paragraph
I am hyperlinked to this, I believe you have a deeper understanding of "css how to select the tag", might as well come to the actual operation of it! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
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.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.