On the morning of April 9, November 19, the css style sheet was created on the morning of April 19.

Source: Internet
Author: User

On the morning of April 9, November 19, the css style sheet was created on the morning of April 19.

--- Restore content start ---

Style sheet:

I. Inline: The style attribute is directly added to the label of the Content in the body. For example, <div>

3. External style sheet: Create a css file

Right-click the file, select css style, and add a style sheet. Add a newly created style sheet. A group of labels starting with the link will appear after the link is saved.

 

 

Selector:

1. Use the tag as the selector: Method: Take the p tag as an example, p {}

<Style> p {/* background color changed by all P labels */background: #000} </style>

2. class selector: the class value can be the same, starting with "."

<Style>. a {/* execute all the labels whose class value is a and change the attribute */background: #9C0} </style> <Div> </div>
</Body>

</Html>

3. id selector: the value of id cannot be repeated and starts "#".

<Head> <style> # a1 {/* the content of the tag whose id is a1. Change the attribute */background: #000} </style> 

4. Compound selector:

(1) separated by commas (,).

<Head> <style> div, p {/* perform this operation on all div and p labels */background: #093 }</style> <P> </p>/* execute the label to change the background color */
</body>

(2) separated by spaces, indicating that future generations need to have an inclusive relationship

<Head> <style> div p {/* p label in the div, the properties executed */background: #093 }</style> </Div>
</body>

(3) Filtering:

<Head> <style> p. a3 {/* among all p tags, only the value of klass is a3 tag */background: #633 }</style> /* Execute this label to change the background color */
</div> </body>

  

--- Restore content end ---

Style sheet:

I. Inline: The style attribute is directly added to the label of the Content in the body. For example, <div>

3. External style sheet: Create a css file

Right-click the file, select css style, and add a style sheet. Add a newly created style sheet. A group of labels starting with the link will appear after the link is saved.

 

 

Selector:

1. Use the tag as the selector: Method: Take the p tag as an example, p {}

<Style> p {/* background color changed by all P labels */background: #000} </style>

2. class selector: the class value can be the same, starting with "."

<Style>. a {/* execute all the labels whose class value is a and change the attribute */background: #9C0} </style> <Div> </div>
</Body>

</Html>

3. id selector: the value of id cannot be repeated and starts "#".

<Head> <style> # a1 {/* the content of the tag whose id is a1. Change the attribute */background: #000} </style> 

4. Compound selector:

(1) separated by commas (,).

<Head> <style> div, p {/* perform this operation on all div and p labels */background: #093 }</style> <P> </p>/* execute the label to change the background color */
</body>

(2) separated by spaces, indicating that future generations need to have an inclusive relationship

<Head> <style> div p {/* p label in the div, the properties executed */background: #093 }</style> </Div>
</body>

(3) Filtering:

<Head> <style> p. a3 {/* among all p tags, only the value of klass is a3 tag */background: #633 }</style> /* Execute this label to change the background color */
</div> </body>

  

Related Article

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.