CSS: External style sheet/inner style sheet/inline style

Source: Internet
Author: User

In HTML, the reference CSS style has 3 ways: external style sheet, inner style sheet, inline style.

This code is compiled from w3school:http://www.w3school.com.cn

(1) An external style sheet, which refers to a style defined in another CSS file by using link in the head tag of the HTML file. If a style sheet needs to be used many times, using an external style sheet is the best choice.

HTML file:

CSS style, Basestyle.css:

H1 {color:red}h2 {color:green}h3 {color:blue}p {color:gray}

(2) An internal style sheet that declares a style within the head tag of an HTML file. An internal style sheet should be used when a particular style is required for a single document.

(3) inline style (generally not recommended), refers to the style that specifies the contents of the tag within an HTML. Inline styles lose many of the benefits of stylesheets because of the mix of performance and content.

<!--inline style--><!--No underlined links--><a href= "http://www.baidu.com" style= "Text-decoration:none" target= "_ Blank > This is a non-underlined link </a>


CSS: External style sheet/inner style sheet/inline style

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.