This article is about some experiences of a netizen when performing W3C XHTML1.0 verification when updating and adjusting the website.
Summarize nine issues that need to be paid attention to when passing the W3C XHTML1.0 standard:
1. What are the errors in the statement <div class=tzh>I am TZH!</div>?
Punctuation issues. This is actually the most easily overlooked problem. In fact, it is just two small quotation marks that cause this error. Although many browsers still recognize the rendering correctly without quotes. However, it is impossible to pass the strict W3C XHTML international standard. Please remember that the equal sign must be followed by quotation marks. Correct writing: <div class="tzh">I am TZH!</div>
2. What are the errors in the sentence <SPAN class="tzh">TZH is me!</SPAN>?
Pay attention to capitalization. This, like the first question, is a detail issue that is particularly easy to overlook. Capital letters are absolutely not allowed in the W3C standards. I still remember that when I was testing a piece of JavaScript code, the onLoad I wrote to make it clear to myself was also judged to be an error. The reason is that L cannot be capitalized. Correct writing: <span class="tzh">TZH is me!</span>
3. In the sentence <p>I am TZH!</p><br><p>TZH is me!</p> What's wrong with ?
<br />Tag issues. As for the forced line break tag <br />, many novices can't tell the difference between it and <br>. Even in the FCKeditor editor, <br> sometimes pops up from time to time to act as <br />. Although many browsers can automatically correct errors and recognize <br> as <br />. But the best editing method is still recommended to use Dreamweaver for editing. When you press Ctrl+Enter, a <br /> will be automatically written. Correct way to write: <p>I am TZH!</p><br /><p>TZH is me!</p>
4. <h1>~tangzhehao~hey~</h1> What are the errors in this sentence? ?
Pay attention to the punctuation marks that follow the end of the tag. Many tags cannot be followed by special punctuation marks, such as the "~" tilde here, but you have to ask, how can I use it? Then use the ISO Latin-1 Character Set. Here, find the decimal code of the character set corresponding to the "~" tilde sign, which is ~, and then use this decimal code to replace the ~ tilde sign, remember The last semicolon cannot be lost. In the ISO Latin-1 character set, the named entity is given priority, followed by the decimal code. That is to say, when a symbol has both a decimal code and a named entity, the named entity is given priority. Decimal encoding is not used.
5. What are the errors in the sentence <form id="54tzh"></form>?
Pay attention to the special cases of id and class. The W3C XHTML1.0 standard stipulates that in id or class, the first character cannot be a number and must be a letter. Correct writing: <form id="tzh45"></form>
6. What are the errors in the sentence <img src="logo.gif">?
Pay attention to the <img> tag. The W3C XHTML1.0 standard stipulates that the alt element must be included in the <img> tag. Correct writing: <img alt="Logo" src="logo.gif">
7. What are the errors in <script language="JavaScript">?
Pay attention to the <script> tag. The W3C XHTML1.0 standard stipulates that the type element must be included in the <img> tag. Correct writing: <script language="JavaScript" type=text/javascript>
8. What are the errors in the sentence <div><h1>I am TZH!</div></h1>?
Pay attention to the corresponding starting and ending order of tags. Correct writing: <div><h1>I am TZH!</h1></div>
9. In addition to the above, what other issues need to be paid attention to?
Watch out for special packages. For example: <dl><dd><ul><li> and other special tags are indispensable in the set sequence. The four tags <dl><dd><ul><li> must be written completely in order. There are many similar ones.
Note that the tab is not open. The so-called not open comes from W3C detection. The error displayed by this type of error is is not open, which means not open when translated. If you understand it according to the Chinese meaning, it means there is a beginning without a tail or there is a tail without a head. Usually the reason for this error is that a piece of code was deleted during modification, without taking into account the relatively distant end or start tags.
Summarized some experiences about W3C CSS standards:
1. Use less bias. It is best to use less clandestine CSS such as break-word, manual layering with z-index, vertical alignment, etc., because not all browsers may support it, and it is extremely difficult to pass W3C detection.
2. Center is not a float value. Many novices will mistake center for the value of float, but it is not the case. center is just the value of text-align.
3. Alignment cannot include two values. Many novices will fill in two values in float or text-align, such as: float:left top. This is not allowed and is not recognized by the browser.
4. It is best not to customize the scroll bar color. Many browsers cannot properly recognize scroll bars with custom colors, and many custom colors cannot pass W3C.
5. Separate scroll bar settings. Nowadays, overflow-x (horizontal scroll bar) or overflow-y (vertical scroll bar) are often used. When setting this, we often find that it does not have the effect on all clients. It is best to set it in the body and html are set at the same time. However, this CSS is not supported by CSS2.1 (CSS2.1 supports overflow and defines horizontal and vertical scroll bars). This definition method was not supported until CSS3. Use as little as possible.
6. If the background and color are the same, you will be warned.