Using Web standards to build a station day 4th: calling a style sheet

Source: Internet
Author: User
Web|web Standard | style sheet |web Standard | stylesheets use Web standards to design Web sites, and the way to transition is primarily to use XHTML+CSS,CSS style sheets. This requires all web designers must be proficient in CSS, if you have not used to use, then start learning now. If you want to make Web-standard Web sites, you don't know how to design a beautiful page with CSS. In fact, all the areas of performance need to be implemented with CSS. We used to use table to locate and layout, and now we want to position and layout using div instead. This is a change in the way of thinking, at first some are not accustomed to. Oh, any change will have resistance, in order to enjoy the "benefits" of the standard, it is worthwhile to abandon some old traditional practices.
External call style sheet
In the past, we usually used style sheets in 2 ways:
Page inline: Just write the style sheet directly in the head area of the page code. Something like this:
<style type= "Text/css" > <!--body {background:white; color:black;}--> </style>
External invocation Method: Write the stylesheet in a separate. css file, and then invoke it in the page head, similar to the following code.
<link rel= "stylesheet" rev= "stylesheet" href= "Css/style.css" type= "Text/css" media= "All"/>
In the design that conforms to the Web standard, we use the external modulation usage, the benefit is self-evident, you can change the page style without modifying the page only. css file. If all pages call the same style sheet file, changing a style sheet file can change the style of all files.

Call style sheet with double table method
To see some of the original code that matches the standard site, you might see the following 2 sentences where the style sheet is invoked:

<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 do you write it two times?

In fact, in general, it is sufficient to call (the first sentence) by the method of outreach. I use two-table calls here as an example. The @import command is used to enter the style sheet. The "@import" command is not valid in Netscape version 4.0 browser. That is, when you want some effect to be hidden in Netscape 4.0 browsers, in more than 4.0 or other browsers, you can call the stylesheet using the "@import" command method.




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.