Summary of four ways of introducing CSS

Source: Internet
Author: User
This article mainly for you to share a CSS introduced four ways to summarize, with a good reference value, I hope to help you. Follow the small series together to see it, hope to help everyone.

1. Inline reference: Directly on the label, but with high maintenance costs

Style= ' Font-size:16px;color: #000000 '

2. External connection reference: CSS code is separated from HTML code for easy code re-use

<link href= "Css/style.css" type= "Text/css" rel= "stylesheet"/>

STYLE.CSS file content such as right:

. font{color:blue;font-size:12px;}

3. Internal reference: The page is clearer, but cannot be used by other pages

<style type= ' text/css ' >    . font{color:blue;font-size:12px;} </style>

4. External import: You can import multiple style sheets in one HTML file. Similar to externally linked references

In the HTML file, add the head tag

<style type= ' text/css ' >    @import url ('./style/style.css ');</style>

Have you learned it? Feel useful and hurry up and collect it.

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.