CSS intersection selector, set selector, sibling selector

Source: Internet
Author: User

One, intersection selector
<! DOCTYPE html><Htmllang="EN" ><Head><Metacharset="UTF-8" ><TITLE&GT;15-CSS intersection selector. html</Title><!--intersection selector, the part that intersects is the label 1 that you want to set the property value in, Format: Selector 1 selector 2 ... {property: value;} 2, Note: (1), the selector does not have any connection symbol (2), the selector can be a label name, or it can be the ID, class name (3), the intersection selector is just about--<Style> P. para1{ColorRed}</Style></Head><Body><P>, I'm a paragraph.</p><p> I'm the paragraph </p><p class="Para1" > I'm the paragraph </ p><p class="Para1" > I am the paragraph </p>< p> I am theparagraph </ p></body></html>          


Two, and set selector
<! DOCTYPE html><Htmllang="EN" ><Head><Metacharset="UTF-8" ><Title>16-css and set selector. html</Title><!--and set selector 1, Format: selector 1, selector 2,... {property: value;} 2, Note: (1), the selector between the use, the connection (2), the selector can be a label name, can also be ID, class name--<Style> . HT,. para{ColorRed}</Style></Head><Body><H1class="HT" > I am the head </h1><p class="Para" > I am the paragraph </p>  <p> I am paragraph </p><p> I am paragraph </p><p> I am a paragraph  </p></body></html>        


Three, brother selector
<! DOCTYPE html><Htmllang="EN" ><Head><Metacharset="UTF-8" ><TITLE&GT;17-CSS brother Selector. html</Title><!--brother Selector, select only Sibling tab 1, adjacent sibling selection (CSS2) format: selector 1+ selector 2{attribute: value;} Note: (1), adjacent selector must use + link (2), the adjacent selector can only select the tag immediately behind, cannot select the separated label 2, The Universal Sibling selector (CSS3), which specifies that all selectors that are behind the selector are selected in the format: Selector 1~ selector 2{property: value;<Style> /*h1+p{*//*color:red;*//*}*/h1~P{ColorRed}</Style></Head><Body><!--<!--<a href= "#" > I am a hyperlink </a>--><!--<p> I'm a paragraph </p>--><!--<p> I'm a paragraph </p>--><!--<p> I'm a paragraph </p>--><!--<!--<p> I'm a paragraph </p>--><!--<p> I'm a paragraph </p>--><!--<p> I'm a paragraph </p>--><h1> I am the title</H1><Ahref="#" > I am a super link</A><P>, I'm a paragraph.</P><p> I'm a paragraph </p> <p> I'm a paragraph </ p><h1> I am the title </h1>< p> I'm a paragraph </p> <p> I'm a paragraph </ p><p> I'm a paragraph. </p></ body></HTML>     
< Span class= "hljs-comment" > < Span class= "Hljs-title" >&NBSP;   

CSS intersection selector, set selector, sibling selector

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.