通不过W3C验证最常见的网页标准错误
刚才到W3C网站验证了一下www.geniusy.com,网站竟然起初有100多处错误,其中有些是由于疏忽导致的,比如多了</p></strong>标记,有<li>而之前没有<ul>或<ol>等,不过有些就是由于以前不清楚标准导致的,比如<img>必须包含alt说明等。
不过查出来错误最多的还是Sablog的JS调用标签,一段标签都N个错误,看来得避免使用JS调用啊。下面是找来的最容易出现的错误:
| HTML Tag | Error | PSU Pilot Frequency |
|---|---|---|
| <img>, <area> | Required attribute ALT not specified | 29.9% |
| <table>, <tr>, <th>, <td> | There is no attribute BGCOLOR | HEIGHT | WIDTH | ALIGN | 10% |
| <ul>, <ol> | Start tag for “LI” omitted, but its declaration does not permit this | 8.6% |
| Any HTML tag | Document type does not allow element <tag> here | 6.2% |
| <font> | Element “FONT” is undefined | 4.5% |
| The align attribute on any tag | There is no attribute “ALIGN” | 3.8% |
| <script>, <style> | There are three commons types of errors on these tags:
|
3.5% |
| All HTML tags | End tag for <tag> omitted, but OMITTAG NO was specified. | 3.4% |
| Page content and all tags using URLs in attribute values | This error can be presented several ways, based on the validator being used, such as:
|
3.4% |
| Any attribute value on any tag | An attribute value must be a literal unless it contains only name characters | 3.3% |
| Any series of tags | End tag for “tag1″ omitted, but OMITTAG NO was specified – AND – End tag for “tag2″ which is not open | 3.0% |
| <body> | There is no attribute:
|
2.9% |
| <b>, <i> |
|
2.8% |
| <!DOCTYPE> | DOCTYPE errors can be found in the following forms:
|
2.4% |
| Content: &128;-&159; | Found an illegal character reference or Character “&” is the first character of a delimiter but occurred as data | 1.8% |
| <hr> | align, noshade, size, and width attributes for <hr> are all deprecated in favor of style sheets | 1.3% |
| <ul>, <ol>, <li> | This error can appear in multiple ways, depended on the validator and the context in which it is contained:
|
1.1% |
| <img> | height and width attributes should be used with the <img> element | 1.0% |
| <body> | Document type does not allow element “body” here | 0.4% |
| id and name attribute on any tag | ID or name attribute already defined | 0.2% |
| <center> | <center> is deprecated | 0.1% |






1条评论▼