DIV+CSS standard page layout easy to appear problem summary

Source: Internet
Author: User
Tags object header
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

Related Article

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.