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.