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 use the function of HTML descendant selector

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

In this article Xiaobian introduces in detail how to use the function of HTML descendant selector for you, the content is detailed, the steps are clear, and the details are handled properly. I hope this article "how to use the function of HTML descendant selector" can help you solve your doubts.

The painstaking guard of the heir decision machine is extremely powerful. With it, work that is impossible in HTML can be made possible.

If you have a document, there is a sidebar and a main area. The backing of the sidebar is blue, the backup of the main area is white, and both zones are netted with a list of links. You cannot configure all the links to be blue, because the blue links in the sidebar cannot be seen.

The method of calculation is to use the elder determiner. In this case, it can be considered that the div that includes the sidebar specifies the class property of sidebar, and the class property value of the main area is set to maincontent. Next, write the following styles:

Div.sidebar {background:blue;} div.maincontent {bac kg round:white;} div.sidebar a:link {color:white;} div.maincontent a:link {color:blue;}

An aspect of irrelevant ancestor selectors that is easy to be overlooked is that the grade isolation distance between two elements can be infinite.

For example, if you write ul em, this syntax selects all em elements that inherit from the ul element, no matter how deeply nesting the em is.

Therefore, ul em will decide on all em elements in the following flags:

List item 1 List item 1-1 List item 1-2 List item 1-3 List item 1-3-1 List item 1-3-2 List item 1-3-3 List item 1-4 List item 2 List item 3, this article "how to use the function of HTML descendant selector" has been introduced. If you want to master the knowledge of this article, you still need to practice and use it. If you want to know more about the articles, you are welcome to follow the industry information channel.

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