For many days, we worked hard to redesign our website using XHTML+CSS. So how do we know that the pages we make are really web-compliant? The Web site and some volunteer sites provide online calibration programs to help us check whether the page is compliant and provide help with correcting errors. These checks are very useful and are the first thing I need to do to debug a page.
1.XHTML Checksum
- Verify URL: http://validator.w3.org/
- Check mode: URL check, file upload check
The checksum succeeds and the "This page is Valid XHTML 1.0 transitional!" will be displayed.
Validation fails, more check options and error messages are displayed,
The general choice of "Show Source" and "Verbose Output" can help you find the error code in the row and the cause of the error.
XHTML Check Common error causes comparison table
- No DOCTYPE found! Falling back to HTML 4.01 transitional--undefined doctype.
- No Character Encoding found! Falling back to utf-8.--no language encoding is defined.
- End tag for ' IMG ' omitted, but Omittag no is specified--picture label does not add "/" off.
- An attribute value specification must be a attribute value literal unless Shorttag YES is specified--property value must be quoted.
- The element "div" Undefined---div tag cannot be capitalized and changed to lowercase div.
- Required attribute "alt" not specified---picture requires ALT attribute.
- Required attribute "type" not specified---js or the tag of the CSS call is missing the type attribute.
One of the most common errors is the case of the label. Often these errors are related, such as forgetting one other
The label will be error-free, so don't see a bunch of bugs, usually solving a bug, and no other mistakes. If your page passes the XHTML1.0 check, you can place an icon on the page: The code is as follows:2.CSS2 Check
- Verify URL: http://jigsaw.w3.org/css-validator/
- Check mode: URL check, file upload check, direct paste code check
The verification is successful and will show "Congratulations congratulations, this document has been verified by the style sheet!" ", HoHo, check information support Chinese OH.
The checksum fails, and two types of errors are displayed: errors and warnings. The error indicates that it must be corrected, otherwise it cannot pass the validation; The warning indicates that there is code not recommended by the "
CSS2 Check common error causes comparison table
- (Error) Invalid number: color909090 is not a color value: 909090---Hexadecimal color value must be "#", i.e. #909090
- (Error) Invalid number: Margin-topunknown dimension:6pixels---Pixels is not a unit value, correct notation 6px
- (error) attribute Scrollbar-face-color does not exist: #eeeeee---Define the scrollbar color is a non-standard property
- (error) value Cursorhand does not exist: hand is a non-standard property value, modified to Cursor:pointer
- Warning line:0 font-family: It is recommended that you designate a family section as the last option--w3c suggest font definitions, end with a category of fonts, such as "Sans-serif", to ensure that the page font can be displayed under 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 validator cannot judge and provide the appropriate warning information.
Similarly, after passing the test, you can place a CSS check through the icon, the code is as follows: