CSS standard web design ul and Div use tips summary

Source: Internet
Author: User
css| Standard | skill | design | Web page design

To understand the content of structured CSS design, look at the following two examples first:

<div id= "NAV" >
<ul>
<li></li>
<li></li>
......
</ul>
</div>

Many people, including many in the industry, have advised you to write this:

<ul id= "NAV" >
<li></li>
<li></li>
......
</ul>

Of course, I personally appreciate the second way of writing, yes, concise, semantic (semantic) conclusive. But wait a minute, if you need to style (stylish) it, which one can provide more control (controll)? Obviously, the first one.

Then, the problem is a bit maddening. In a word: Are you the structure (markup) first, or the performance (presentation) first? I believe that in today's not-so-good times, performance first is the norm. A lot of people with ideals, including me, in the end, in order to achieve the needs of performance, tag soup (tag soup) is actually difficult to avoid.

So, this can only be a matter of degree. Don't abuse it. No abuse, no rules. My personal guidelines are: if you want to achieve a performance need, you use more than three layers of peripheral labels (wrappers?), you should stop to think about it. Although a bit old, I suggest you take a look at some interesting discussions on Simplequiz.

Why is that? Because everything is not perfect. Imagine that if CSS can provide more rules to control the elements on the page, it might not be so embarrassing. For example, Background-image support TRLB (upper right and left) four different direction of the picture, we do not have to deal with rounded corners and racked our brains, support from the page to produce elements, such as content, then also can greatly reduce the use of tag ...

Xhtml? Joke. In fact, so far not many people are using XHTML, everything is self-deception. XHTML is dead! XHTML is XML, with all the advantages of XML, but what we see now is text. If text is treated as XML, it is harmful (sending XHTML as text/html considered harmful).

Although we have doctype that we are using XHTML, we are actually using HTML. This is the reality. Otherwise, how could the flawed, unstructured pages be displayed in a tolerant contemporary browser ... It's no wonder that XHTML 1 is only a refinement of HTML 4. However, future XHTML 2 is not backwards compatible, and I don't know what we need to use XHTML 1. In addition, don't take accessibility to refute me, the separation structure and performance of the HTML 4 does not have any difference with XHTML 1.

So, perhaps, the significance of using XHTML 1 is to claim that we already have such ideas and to be ready for the future of XHTML 2.

That's why I strongly recommend using HTML 4.01 Strict doctype. From the company/enterprise, it is not easy to ask the whole team to have the idea of web standards and implement the relevant principles, and all the ideas left over from the last century are still in a last-ditch struggle. If you really use XHTML 1, many JavaScript scripts that can only be HTML-compliant will fail, and editing an inadvertently escaped character can cause an entire page error (XML parsing error), and so on. To avoid problems, perhaps the HTML 4.01 Strict DOCTYPE is now the best choice.



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.