CSS three types of Insert style table format

Source: Internet
Author: User

First, a simple understanding of the browser and Web page interaction process

CSS style sheet (stylesheet)

Cascading style sheet cascading style sheet

Performance Computer language for HTML or XHTML file styles: Includes settings for font, color, margins, height, background picture, page positioning, and more

CSS Benefits: Separation of content from performance

Web page performance is unified, easy to modify

Rich styling to make the page layout more flexible

Reduce the amount of Web page code, increase the browsing speed of Web pages, save network bandwidth

using page-independent CSS facilitates web pages to be indexed by search engines

There are three ways to insert a CSS style sheet:

external style sheet (External style sheet)

The difference between a link and an import

1 <link rel= "stylesheet" type= "Text/css "

href= "path">

<style type= "Text/css">

@import url (path);

</style>

<link/> tags are XHTML,@import belong to CSS2.1

use the <link/> linked CSS file to load into the Web page before compiling the display

using the @import imported css file, the client displays the HTML structure and then the CSS file is loaded into the Web page

@import is unique to CSS2.1 and is not valid for incompatible CSS2.1 browsers .

Internal style sheet (Internal style sheet)

CSS code written in <style> tags

<style>

H1{color:green;}

</style>

Pros: Easy to modify styles on the same page

Disadvantage: not conducive to the sharing of multiple pages between the code and maintenance, the separation of content and style is not complete.

Inline styles (inline style)

using the style property to introduce CSS Styles

application of >style attributes

<p style= "Font-size:14px;color:green;" > Set the style directly in the HTML tag </p>

CSS three types of Insert style table format

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.