Reference the css style writing format, css style Writing

Source: Internet
Author: User

Reference the css style writing format, css style Writing

There are three types of css writing formats.

Intra-row style: Write a style in the row.

For example, <p style = "color: red"> write my colors in a row style </p>

Only applicable to labels in <body> (font color and background color) and <body>, but not to labels other than <body> such as head, title, etc.

 

Embedded Style: Use style to unmount all styles.

For example:

<Head>

<Style>

P {

Color: red;

Background: blue;

Border: 1px solid green;

}

</Style>

</Head>

<Body>

<P> write my style in Embedded mode </p>

</Body>

 

External Style: Use the link sample to connect to the external. CSS file.

For example:

<Head>

<Link style = "stylesheet" href = "class.css" type = "text/css"/>

</Head>

It's easy. Just write the CSS sample to another. CSS text and then you only need link to display the style on the page, but be sure to pay attention to the file path !!! The path is incorrect and cannot be dropped.

I personally recommend that you use the external style to separate css from the layout code, so that the code can be edited and loaded faster.

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.