css| Standard | homepage | question
The application of DIV+CSS Web page layout, the production of Web-standard Web site, easy to appear some problems.
Now summarize so that you can see that the problem is there.
A. CSS checksum problem
We design Web pages that are expected to conform to XHTML standards, CSS through the verification of the consortium. Some failed to pass the CSS2.0 checksum, the main checksum error is: "line:0 font-family: It is recommended that you designate a family of species as the final option."
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" can ensure that Web 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
Often we pay attention to the verification of CSS, 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 is correct in HTML4.0 and is not allowed in XHTML1.0. One solution is to write target= "new", another way is to use JS to handle all the target;
The stylesheet is best not to embed, it is easy to maintain the style sheet file independently. If inline