Many of my friends told me that she/he has code cleanliness, that is, she/he is never willing to add additional tags if she/he writes XHTML ). For a simple example, I believe many people have seen this in many places:
| The code is as follows: |
Copy code |
<Div id = "nav"> <Ul> <Li> </li> <Li> </li> ...... </Ul> </Div>
|
Many people, including many industry experts, suggest you write the code like this:
| The code is as follows: |
Copy code |
<Ul id = "nav"> <Li> </li> <Li> </li> ...... </Ul>
|
Of course, I personally appreciate the second method, which is correct, concise and clear, and the semantics (semantic) is conclusive. But please wait. Which of the following controls can be provided if stylish is required )? Obviously, the first type.
Then, this problem is a little crazy. In a word, do you have a structure (markup) priority or a presentation priority? I believe that in today's bad age, performance first prevails. Many people who have ideals, including me, are hard to avoid tag soup in the end to meet their performance needs.
Therefore, this is only a matter of degree. Do not abuse it. There are no rules for abuse. My personal principle is: if you want to implement a performance requirement, you use a peripheral tag (wrappers?) over three layers ?), You should stop and think about it. Although it is a bit old, I suggest you take a look at some interesting discussions above SimpleQuiz.
Why? Because everything is not perfect. If CSS can provide more rules to control elements on the page, it may not be so embarrassing. For example, if background-image supports four images in different directions (top-right-bottom-left), we do not need to poll our brains to process rounded corners; if we support generating elements from pages, such as content, this can also greatly reduce the use of tags ......
XHTML? Joke. In fact, not many people are using XHTML so far. Everything is self-deception. XHTML is Dead! XHTML is xml and has all the advantages of xml. However, what we see now is text. If text is treated as xml, this is Harmful (Sending XHTML as text/html Considered Harmful ).
Although we have indicated in Doctype that we are using XHTML, we are actually using HTML. This is a reality. Otherwise, how can a page with hundreds of errors and poor structures be displayed in a tolerant contemporary browser ...... It's no wonder that XHTML 1 is only an improvement of HTML 4. However, the future XHTML 2 is not backward compatible. I don't know what we need to use XHTML 1. In addition, do not refute me with accessibility. The separation structure and the representation of HTML 4 are not different from those of XHTML 1.