The type and format of the CSS sibling selector
This article mainly explains the "CSS brother selector type and use format", the content of the article is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn the "CSS brother selector type and use format" bar!
1. The neighboring sibling selector, which sets attributes for the selected tag of the selector immediately following the specified selector.
Format:
Selector 1 + selector 2 {attribute: value;}
The neighboring sibling selector must be connected through +.
The neighboring sibling selector can only select the tag immediately following it, not the separated tag.
2. Universal sibling selector, which sets attributes for all tags selected by all selectors behind the specified selector.
Format:
Selector 1 ~ selector 2 {attribute: value;}
The universal brother selector must be connected with ~.
The universal sibling selector selects all tags selected by a selector behind the specified selector, regardless of whether it is separated or not.
Thank you for your reading, the above is the "CSS brother selector type and the use of format" content, after the study of this article, I believe you on the CSS brother selector type and the use of format this problem has a deeper understanding, the specific use of the situation also needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!