In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article will introduce in detail for you "how to use the descendant selector in the css language", the content steps are clear and detailed, and the details are properly handled, and the editor will update different knowledge points every day. I hope this article "how to use the descendant selector in the css language" can give you unexpected gains.
In css, the descendant selector is used to select all specified descendant elements of a specific element or group of elements, putting the selection of the parent element first, and the selection of the child element after it, separated by a space in the middle, and the syntax is "parent element {css style}".
The operating environment of this tutorial: windows7 system, CSS3&&HTML5 version, Dell G3 computer.
The descendant selector, also known as the inclusion selector, is used to select the descendants of a specific element or group of elements, putting the selection of the parent element first and the selection of the child element later, separated by a space in the middle.
Descendant selector centralized form:
1. The parent * {} finds all the children from the parent.
2. The parent child 1 {} is to find the child 1 from the father, or the parent child 2 {} is to find the child 2 from the parent.
3. Father generation 1 child generation 2 {} this is to find the child 1 from the father, and then find the child 2 from the child 1.
There are not only two elements in the descendant selector, but multiple spaces can be separated for multi-tier ancestor-descendant relationships. For example, if id is the three elements of a, b, and c, the descendant selector can be written in the form of # a # b # c {}, as long as the selection of ancestral elements is separated by spaces before and in the middle of the descendant elements.
The first form: although all are selected, * has a lower priority.
Div {padding: 20px; background: rgba; / / this is to give it a red with a transparency of 0.2} .a * {border: 2px solid black / / here are all descendants of selected class a} a b c
The second form:
Div {padding: 20px; background: rgba;} .a .b {border: 2px solid black; / / similarly it is possible to choose .c here because they are all descendants of .a. } a b c
The third form: it can not select both .b and .c, only .c.
Div {padding: 20px; background: rgba;} .a .b. C {border: 2px solid black;} a b c
It is also important to note the following code: if a p is nested in a p with the class name c and then a p with the class name c, it will also be selected.
Div {padding: 20px; background: rgba;} .a .b. C {border: 2px solid black } what is the full name of a b c span css css is Cascading Style Sheets (cascading style sheets) It is a computer language used to express file styles such as HTML or XML. CSS can not only modify the web page statically, but also format the elements of the web page dynamically with various scripting languages.
Thank you for reading this. I hope you have the most profound experience from the practical level on the key issue of "how to use the descendant selector in the css language". If you want to read more related articles, 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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.