Introduction to Web standard learning path: 6. Calling Style Sheets

Source: Internet
Author: User

Disclaimer: this series of e-books and other data collection from <Author: A Jie>.

 

Call a style sheet

Author: A Jie2004-6-24 21:05:05

To design websites with web standards, the transition method is mainly to use XHTML + CSS, and CSS style sheets are essential. This requires all web designers to be familiar with CSS. If you are not familiar with CSS before, start learning it now. To make a website that complies with the web standards, CSS cannot be designed with beautiful pages.

In fact, CSS is used to implement all the performance. We used to use table to locate and layout. Now we need to use Div to locate and layout. This is a change in the way of thinking. Haha, any change will have resistance. To enjoy the "benefits" brought by standards, it is worthwhile to give up some old traditional practices.

External call style sheet

In the past, we usually used2To use a style sheet:

·Embedded PAGE method: You can directly write the style sheet on the page.CodeOfHead. Similar to this:

<Style type = "text/CSS"> <! -- Body {Background: white; color: black;} --> </style>

·External call method: Write the style sheet in an independent. CSSFile, and then on the pageHeadUse code similar to the following.

<LINK rel = "stylesheet" REV = "stylesheet" href = "CSS/style.css" type = "text/CSS" Media = "all"/>

In the web-compliant design, we use the external calling method. You can change the page style by modifying the. CSS file without modifying the page. If all pages call the same style sheet file, you can change the style of all files by changing the style sheet file.

Two-table method call style sheet

Check the original code of some compliant sites. You may see the following two sentences in the style sheet:

<LINK rel = "stylesheet" REV = "stylesheet" href = "CSS/style.css" type = "text/CSS" Media = "all"/> <style type = "text/ CSS "Media =" all "> @ import URL (CSS/style01.css ); </style>

Why write twice?

In fact, it is enough to use the external method to call (that is, the first sentence. I use a double table call here as an example. The "@ import" command is used to input a style sheet. The "@ import" command is invalid in the Netscape 4.0 browser. That is to say, when you want to hide some effects in the Netscape 4.0 browser and display them in more than 4.0 or other browsers, you can use the "@ import" command to call the style sheet.

 

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.