CSS style sheet settings

Source: Internet
Author: User

Refer to this blog post

1. Inline style sheet

Refers to the CSS style encoding written in the HTML tag, the style written within the label can affect the smallest range, only change the text style of the label, the same label will not be affected, also known as the row style table.

The format is as follows

The inline style sheet is supported by the style of the HTML element of the HTML element, just separating the CSS code with a semicolon in style= "". This is the most basic form, but it does not implement the performance and content separation and cannot control multiple pages flexibly, so we just use when debugging CSS code.

2. Internal style sheet

In HTML, you can set styles that affect the entire document through the Apply <style> tag, and the inner style sheet can put the style in a fixed position when compared to the rows.

The format is as follows

The internal style sheet encoding is the primary application form and cannot be used for cross-page use.

3. External style sheet

3.1 We used the <link> tag in

The code for the external style.css is:

H1{font-size:12px;color: #000FFF}

3.2 Referencing an external style sheet using @import

@import used within the <style> tag and must precede other CSS styles, the syntax code is as follows:

@import URL (external style address)

URL is a keyword, can not be arbitrarily changed, external style address refers to the external style of the URL, can be absolute, can also be relative, in addition to the syntax and location and <link> tag, the other uses and effects are the same.

<style type= "text/css" > @import url (8.4.1.css); h1{color:red}</style>

Notice that there is a semicolon behind it.

CSS style sheet settings

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.