Why use ul> li instead of dddtdl for the navigation bar? -

Source: Internet
Author: User
0 reply content: @ Ding XiaoYu's statement is a bit extreme. The element is the block content, that is, the elements generated by the document outline (outline. It only reflects its content including navigation, but does not express its content form. The navigation content can be a list of links or a natural text embedded with navigation links.

By W3C Description of an element (http://dev.w3.org/html5/spec/the-nav-element.html#the-nav-element :


    
      
     
  
      
  • href="/home">Home
  •   
  • href="/about">About
  •   
  • href="/links">Links
  •  
In fact, using ul> li in navigation is an error, not a list project, but a link. There has been a flood of domestic applications, and many new people have been misled. Don't think so complicated.
Html5 It is the true realization of the semantic nature of navigation tags, and nav> a is sufficient. I agree with @ Gu Qingling. Dl dt dd is a name-value pair. Applicable scenarios include a list of values such as the curriculum and calendar. Navigation itself is an unordered list containing multiple links, which complies with ul> li semantics. Html5 The tag is more accurate to the semantics of the navigation list. For details, see @ li, or use the nav + a tag, in html5, how do I write the navigation menu? From the semantic point of view, dt and dd in the dl (Definition Lists) label must appear in pairs. Dt is Definition Term, that is, Definition, and dd is Definition Description. Therefore, it does not conform to the "navigation" syntax 」. In addition, considering the page structure, the paired form obviously does not conform to the common form of navigation. First link
Semantic your HTML tags and attributes
Http://bbs.blueidea.com/thread-2658231-1-1.html
Dl is the "definition list ". For example, this list can be used to explain and define words in a dictionary.
So it is not suitable for listing. In addition, what should we do if we use the dl dt dd structure. Use dl as dd? If you don't need to consider the maintainability of the code, I think it is appropriate to use p> a for simple navigation.
If html5 is simple, you can directly use nav> a. When the elements in the navigation bar are unordered list items, ul> li should be used, if you need to explain it, you can use dl> dt> dd (who needs to explain it in the navigation bar? It is not a new word table ).
I agree to your direct nav>. Ul li is an unordered list, and navigation itself can be represented by Unordered Lists. Dl dt dd. This way of defining the list is used here for semantic tags.

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.