Yesterday this site (http://www.tangzhehao.com.cn) from XHTML1.0 has 121 errors and CSS nearly 10 errors, I spent nearly two hours, all the errors will be done. The accumulated skills are as follows. To impress everyone, we adopt the question-making and summary methods.
W3C XHTML 1.0 International Standard:
Question 1: In <div class = tzh> I am TZH! </Div> what are the errors in this statement?
1. punctuation. This is actually the most easily overlooked problem. In fact, this error is caused by a small pair of quotation marks. Although many browsers still correctly recognize rendering without quotation marks. However, it is impossible to pass the strict W3C XHTML international standard. Remember that the equal sign must be enclosed by quotation marks. Correct syntax: <div class = "tzh"> I am TZH! </Div>
Question 2: In <SPAN class = "tzh"> TZH is me! </SPAN> what are the errors in this statement?
2. Note the case sensitivity. This is the same as the first issue. It is a very easy-to-ignore detail issue. In W3C standards, uppercase letters are definitely not allowed. I still remember that when I was detecting a piece of javascript code, the onLoad I wrote at a glance was also judged to be incorrect, the reason is that L cannot be capitalized. Correct syntax: <span class = "tzh"> TZH is me! </Span>
Question 3: In <p> I am TZH! </P> <br> <p> TZH is me! </P> what are the errors in this statement?
3. <br/> tag issues. For a forced line feed label <br/>, many new users cannot tell the difference between it and <br>, even in the FCKeditor, A <br> may appear from time to act as <br/>. Although many browsers can automatically correct errors, <br> is used as <br/> recognition. However, it is recommended that you use Dreamweaver to edit the file. When you press Ctrl + Enter, the file is automatically written to the previous file. <br/>. Correct syntax: <p> I am TZH! </P> <br/> <p> TZH is me! </P>
Question 4: In 4. Pay attention to the punctuation marks followed by the end of a tag. Many tags cannot be followed by special punctuation marks. For example "~ "Wave number, but you have to ask, how can I use it? Use the ISO Latin-1 Character Set (ISO Latin-1 Character Set). Here, find "~". The decimal encoding of the character set corresponding to the Tilde is & #126;, which is then replaced by this decimal encoding ~ The Tilde. Remember that the last semicolon cannot be lost. In the ISO Latin-1 Character Set, Named entities are given the highest priority, while Decimal codes are followed, that is, when a symbol has both the decimal encoding and the named object, the named object is preferentially used instead of the decimal encoding.
P.S.: ISO Latin-1 Character Set address: http://www.tangzhehao.com.cn/css/z_iso.html
Question 5: What are the errors in the <form id = "54tzh"> </form> statement?
5. Pay attention to the special situations of id and class. The W3C XHTML1.0 Standard specifies that the first character in id or class cannot be a number or a letter. Correct syntax: <form id = "tzh45"> </form>
Question 6: What are the errors in the statement?
6. label note. The W3C XHTML1.0 Standard specifies that the label must contain the alt element. Correct syntax:
Question 7: What are the errors in the <script language = "JavaScript"> statement?
7. <script> note. W3C XHTML1.0 standard stipulates that the label must contain the type element. Correct syntax: <script language = "JavaScript" type = text/javascript>
Question 8: In <div> 8. Note that the label start and end sequence corresponds. Correct syntax: <div>
9. Pay attention to special suits. For example, some special tags such as <dl> <dd> <ul> <li> are indispensable in the set sequence. The <dl> <dd> <ul> <li> labels must be completely written in sequence. There are many similar examples.
10. Note that the tag is not enabled. The so-called unopened error is detected by W3C. The error is not open, which means that it is not opened. To understand the meaning in Chinese, there is no beginning or end. Generally, this error occurs because a piece of code is deleted when it is modified, but the end or start label is not taken into account.
W3C CSS international standards:
1. Use less remedies. Similar to break-word, z-index, manual layering, vertical alignment, and so on, it is best to use less, because not all browsers support it and it is very difficult to pass W3C detection.
2. The center is not a float value. Many new users mistakenly think of the center value as a float value, but this is not the case. Center is only the value of text-align.
3. Alignment cannot contain two values. Many new users fill in two values in float or text-align, for example, float: left top. This is not allowed and cannot be identified by the browser.
4. It is best not to customize the color of the scroll bar. Many browsers cannot normally recognize the scroll bars of custom colors, and many custom colors cannot pass W3C.
5. Set a separate scroll bar. Currently, overflow-x (horizontal scroll bar) or overflow-y (vertical scroll bar) are often used. When this is set, it is often found that not all clients have an effect, it is best to set both the body and html when setting. However, CSS is not supported by CSS2.1 (CSS2.1 supports overflow and defines horizontal and vertical scroll bars at the same time). It is not supported by css3. Use as few as possible.
6. If the background and color are the same, a warning is triggered.
At the end, if your site passes W3C detection, you will get the W3C certified Logo (the figure on the left is W3C XHTML 1.0, and the figure on the right is W3C CSS)
For the time being is the above points, if you think there is anything else can communicate with each other, you can also contact me http://www.tangzhehao.com.cn