1. Intersection Selector
<!DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" "Http://www.w3.org/TR/html4/loose.dtd "><HTML><Head> <Metahttp-equiv= "Content-type"content= "Text/css;charset=utf-8"> <title>Intersection Selector</title> <styletype= "Text/css">P{Color:Blue;font-size:18px; }P.P1{Color:Red;font-size:24px; }. P1{Color:Black;font-size:30px; } </style></Head><Body> <P>Using the P tag</P> <Pclass= "P1">Text with P.P1 specified</P> <H3class= "P1">Specifies the title of the. P1 category</H3></Body></HTML>
2. Set Selector
<!DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" "Http://www.w3.org/TR/html4/loose.dtd "><HTML><Head> <Metahttp-equiv= "Content-type"content= "Text/css;charset=utf-8"> <title>and set Selector</title> <styletype= "Text/css">H1,h2,h3,p,span{Color:Red;font-size:12px;Font-weight:Bold; } </style></Head><Body> <P>Here is the P tag</P> <H1>Here's the H1 tag.</H1> <H2>Here's the H2 tag.</H2> <H3>Here's the H3 tag.</H3> <span>This is the span tag.</span></Body></HTML>
3. Descendant Selector
<!DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" "Http://www.w3.org/TR/html4/loose.dtd "><HTML><Head> <Metahttp-equiv= "Content-type"content= "Text/css;charset=utf-8"> <title>Descendant Selector</title> <styletype= "Text/css">H1 span{Color:Red; } </style></Head><Body> <H1>This is the text within the H1 tag<BR><span>This is the text in span under the H1 tag</span></H1> <H2>This is the text within the H2 tag<BR><span>This is the text in span under the H2 tag</span></H2> <H2></H2> <H1>Text within a separate H1</H1> <span>Text within a separate span</span></Body></HTML>
"Composite selector"