Web|web Standard | problem | style sheet Author: Atzie 2004-11-8 11:36:30
The first resume style sheet design competition has been awarded the winning works, congratulations to all the winners, but also encouraged all the outstanding players to continue to refuel. I want to sum up the problems that exist in the works so that we can see what is going on there.
A. CSS checksum problem
First, according to the requirements of the competition, the entries must conform to XHTML standards, and the submitted CSS must be validated by the consortium. CSS Check the situation is more ideal, the entries only 8 works failed CSS2.0 Check, the main error is: "line:0 font-family: suggest you designate a family of species as the final choice."
When the consortium recommends a font definition, it ends up with a font of one category instead of ending with a single font. For example, "Sans-serif" to ensure that the page fonts can be displayed under different operating systems.
Although most people define "Sans-serif" on the body tag, the SANS-SERIF is omitted when another font is defined in another ID or class, and is considered to be a checksum. This error is not very serious, as long as a little attention can be avoided.
Two. CSS writing suggestions
- Annotate the CSS file. Comments will be convenient for your future maintenance, it is recommended to annotate CSS files whenever possible, do not worry about adding a small number of bytes.
- Try to abbreviate CSS syntax. For example, the color value "#FFFFFF" can be written as "#FFF"; padding-top:30px; Padding-right:0;padding-bottom:10px;padding-left:2 0px "can be abbreviated to" padding:30px 0 10px 20px; ". There are more savings tips on defining skills, and you'll find better ways to keep up with the use of CSS.
Three. XHTML checksum problem
Because it is the style table competition, we pay attention to the CSS checksum, but in the XHTML compliance with the standards of a little overlooked, there are many low-level errors. The main issues are listed below:
- Target= "_blank", this syntax in HTML4.0 is correct, in XHTML1.0 is not allowed to use. One of the solutions is to write target= "new", and another way is to use JS to handle all target;
- Style sheets are best not embedded, and the stylesheet files are independent and easy to maintain. If inline