ArticleDirectory
- 1. XHTML Verification
- 2. css2 Verification
After several days of hard work, we tried to use XHTML + CSS to redesign our website. So how do we know that the pages we create really comply with web standards? W3C and some volunteer websites provide online verificationProgramTo help us check whether the page meets the standards and provide help information for correcting errors. These verifications are very useful and are the first step on my debugging page.
1. XHTML Verification
- Verification URL: http://validator.w3.org/
- Verification Methods: website verification and file upload Verification
If the verification is successful, "This page is valid XHTML 1.0 transitional!" is displayed! ",
If verification fails, more verification options and error messages are displayed,
Generally, "Show source" and "verbose output" can help you locate errors.CodeRow and cause of error.
XHTML verification common error causes table
- No doctype found! Falling back to HTML 4.01 transitional -- The doctype is not defined.
- No character encoding found! Falling back to UTF-8. -- language encoding is not defined.
- End tag for "IMG" Omitted, but omittag no was specified -- the Image Tag is not added.
- An Attribute Value specification must be an attribute value literal unless than tag yes is specified -- the attribute value must be enclosed in quotation marks.
- Element "Div" undefined --- the DIV tag cannot be in upper case and must be changed to lower case Div.
- Required attribute "Alt" not specified --- the image must contain the alt attribute.
- Required attribute "type" not specified --- the type attribute is missing in the tag called by JS or CSS.
The most common error is the case sensitivity of tags. These errors are usually associated. For example, if you forget one of the </LI> Other <li> labels, an error is reported. Therefore, do not be afraid to see a bunch of errors. An error is usually solved, none of the other errors. If your page passes the xhtml1.0 verification, you can place such an icon on the page: the code is as follows:
<P> <a href = "http://validator.w3.org/check/referer"> </a> </P>
2. css2 Verification
- Verification URL: http://jigsaw.w3.org/css-validator/
- Verification Methods: website verification, File Upload verification, and direct code verification
"Congratulations, this document has passed the style sheet validation! ", Hoho, the verification information supports Chinese.
If verification fails, two types of errors are displayed: errors and warnings. The error indicates that the Code must be corrected; otherwise, the Code cannot pass verification. The warning indicates that the Code is not recommended by W3C and is recommended to be modified.
Css2 check common error causes table
- (Error) Invalid Number: color909090 is not a color value: 909090 --- The hexadecimal color value must be added with "#", that is, #909090
- (Error) Invalid Number: margin-topunknown dimension: 6 pixels --- pixels is not a unit value. The correct syntax is 6px.
- (Error) The scrollbar-face-color attribute does not exist: # eeeeee --- defines that the color of the scroll bar is not a standard attribute.
- (Error) value cursorhand does not exist: hand is not a standard attribute value, changed to cursor: pointer
- (Warning) line: 0 font-family: It is recommended that you specify a category family as the final choice-W3C suggests that the font should end with a category font when defining the font, for example, "Sans-serif" to ensure that the webpage fonts are displayed in different operating systems.
- (Warning) line: 0 can't find the warning message for otherprofile -- indicates that there are non-standard attributes or values in the code, and the verification program cannot judge and provide the corresponding warning information.
Similarly, after passing the verification, you can place a CSS verification icon. The Code is as follows: