CSS combined with HTML

Source: Internet
Author: User
Tags html header

CSS is combined with HTML in 4 ways:

1. Each HTML tag has a style attribute

2. When more than one label in the page has the same style, you can define a style label to wrap the styles to reuse

<style type= "text/css" >CSS code </style>

3. When multiple pages use the same style, you can encapsulate the style individually as a CSS file import

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

4. Link a CSS file via the link tag in the HTML header tag

<link rel= "stylesheet" href= "1.css" Media properties optional, default device screen/>

Tip: To improve the reusability and extensibility of styles, define and encapsulate multiple styles separately as CSS files, such as P.css, div.css ... In a total CSS file, import these CSS files using import, and then import the total CSS file in the HTML page with the link tag.

CSS combined with HTML

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.