Four css writing methods and four css writing methods

Source: Internet
Author: User

Four css writing methods and four css writing methods

Priority: external style <internal style sheet <inline style sheet;

Priority, that is, the right of the selector with the same name will overwrite the left

1. Internal Style Sheets

<Head> <style>/* internal style table, which is generally used to overwrite public styles */# headTip {color: 0xff5 ;}</style>  

2. Use the link tag to declare the use of external resources in the document. This is the most common method.

The css external style table specifies the encoded @ CHARSET = "UTF-8"; it must be placed in the first line.

<Head> <link href = "./my-common.css" rel = "stylesheet" media = "screen" type = "text/css"/> 

3. @ method: Introduce css. Note that this is asynchronously loaded. It is loaded only after the entire html file is loaded, leading to page flashing. It is not recommended.

<Head> <style> @ import 'my-common.css '; </style>  

4. inline style sheets have the highest priority and are straightforward, but they cannot be reused and are not easy to maintain.

<Body> <input type = "text" style = "color: 0x550; font-size: 30px;"/> </body>

 

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.