"Composite selector"

Source: Internet
Author: User

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"

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.