<!DOCTYPE HTML><HTMLLang= "en"><Head> <MetaCharSet= "UTF-8"> <title>Title</title> <Linkrel= "stylesheet"href= "Tzy.css"type= "Text/css"> <styletype= "Text/css">[title]{ /*Property Selector*/Color:Brown; }[Title=te]{ /*Property Selector Add value selector*/Color:Cadetblue; } </style></Head><Body><H1>the style sheet is applied</H1><H2>Style 2</H2><H3>Style 3</H3><P><Strong>This style references the strong derived selector</Strong></P><ul> <Li> <Strong>This will be selected by the Li strong derivation selector</Strong> </Li></ul><DivID= "pid"><P>This will refer to the ID selector</P></Div><PID= "PPD">This will use the ID selector.<ahref= "Http://www.baidu.com">This will use the derived selector</a></P><Pclass= "Pclass">This will refer to the class selector</P><Pclass= "Pclass">This will use the class selector<ahref= "Http://www.baidu.com">This will use the derived selector</a></P><Ptitle= "P">Property selector refers to a value that can be arbitrarily written</P><Ptitle= "TE">The property selector refers to a selector that does not indicate a value if it is written differently than the specified value</P><Ptitle= "Te1">The property selector refers to a selector that does not indicate a value if it is written differently than the specified value</P><PID= "P1">Save Private Ryan .<span>White Snake Biography<span>Declaration of Independence</span></span></P><P>Save the soldiers.<span>White Snake Biography<span>Big belly.</span></span></P></Body></HTML>
h2,h1{/*Selector Grouping*/Color:Blue;font-family:italics;font-size:50px;}Body{/*If no style is defined, it will refer to the body style (which can be understood as inheritance) .*/Color:Aqua;}Li Strong{/*Derived selectors*/Color:Bisque;}Strong{/*Derived selectors*/Color:#FF00FF;}p span span{/*Derived selectors*/font-family:"in italics";}#p{/*ID selector using #*/Color:Aquamarine;}#ppd a{/*the ID selector and the derived selector work together*/Color:Blueviolet;}. Pclass{/*class selector. Using*/Color:Darkgreen;}. Pclass a{/*class selector with derived selectors*/Color:Blue;}
HTML Learning Note CSS Learning selector case Section fifth (original) Reference use table