4th days: Calling style sheets to design websites using web standards. The main method of transition is to use XHTML + CSS, and css style sheets are indispensable. 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.
Before calling a style sheet externally, we used two methods to use the style sheet:
- Page embedding: The style sheet is directly written in the head area of the page code. Similar to this:
- External call method: Write the sample table in an independent .css file, and then use the code similar to the following in the page head area.
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:
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.