<nav><ul><li><a>

Discussion in 'HTML & Website Design' started by KewL, Aug 3, 2014.

  1. #1
    Can someone explain to me the reason people are doing this? I pretty much do this on every site just because everyone else does, and everytime the <ul> and <li> seem pointless,

    Back when xhtml was the latest and greatest it made more sense. The <ul> grouped everything together, but now in html5 the <nav> tag does just that and let's the client know it's a navigation. Why not go:

    <nav>
      <a></a>
      <a></a>
      <a></a>
    </nav>
    Code (markup):
    Just wondering, opinions?
     
    KewL, Aug 3, 2014 IP
  2. ImbaGroup

    ImbaGroup Greenhorn

    Messages:
    90
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    18
    #2
    The spec says that a nav element doesn't have to contain a list, so basically it's up to you.

    For example if you want nesting (multi-level menu) <ul>s can be handy.
     
    ImbaGroup, Aug 3, 2014 IP
    GORF likes this.
  3. GORF

    GORF Well-Known Member

    Messages:
    224
    Likes Received:
    21
    Best Answers:
    3
    Trophy Points:
    165
    #3
    There are countless JavaScript multi-level drop-down menu scripts out there that work off of the UL/LI structure. They are very simple to use and many work on the HTML4 and 5 standards.
     
    GORF, Aug 3, 2014 IP
  4. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #4
    Because those anchors would be a run-on sentence without block level containers (or at least punctuation) to say otherwise. Remember, the ONLY reason NAV exists (despite claims to the contrary by people who use it without understanding it) is to say "this is a navigational section the user-agent (browser) can skip to get to the content" -- that's what it's FOR. It provides no structural or semantic meaning to it's content. IT DOES NOT MEAN "THIS IS A MENU"!!!!!!!!!!

    Statements like Imbagroup's have it backwards thanks to misunderstanding the specification. NAV can wrap almost anything that's "navigational" aka not content the UA can skip past to get to the content. That means you could have headings, paragraphs, forms, or any of a dozen other things in there. Web search could be considered a form of navigation, so it's form could go right in there NEXT TO the UL that's the menu.

    A menu is still a list of choices, mark it up with a list... It may be part of a navigational section, but that doesn't say WHAT it actually is. The abuse of NAV for something it doesn't mean is as bad as how most people are abusing ASIDE for sidebars, making it about as semantic as the CENTER tag!

    Of course, NAV's purpose is completely redundant to numbered headings if UA's (browsers) would implement heading navigation like they were supposed to a decade and a half ago... as are idiotic halfwit tags like SECTION, ARTICLE and ASIDE. (don't even get me STARTED about ASIDE)... but of course all that is why I consider most of the new HTML 5 tags to be pointless redundant bull that does nothing but justify outdated coding practices and undo the past decade and a half of progress. It's a bunch of pointless code bloat, redundant semantics (which honestly is as bad as no semantics) and overall reeks of everything that was wrong with 4 transitional.

    That anyone is dumb enough to see anything resembling merit in HTML 5 is shocking to me; and it's pathetic how it's becoming more of a sick buzzword used by people who don't know what it is, much less when to or not to use it. Even worse is when people start lumping all the useful stuff that has NOTHING TO DO WITH MARKUP under it's banner like the new scripting and CSS3... though they have to do that as without them the Emperor is standing there bare for the world to see.
     
    deathshadow, Aug 3, 2014 IP
  5. ImbaGroup

    ImbaGroup Greenhorn

    Messages:
    90
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    18
    #5
    "Statements like Imbagroup's have it backwards thanks to misunderstanding the specification"

    I practically wrote the same what you posted just in 1 sentence instead of a( mostly offtopic) rambling wall of text.
     
    ImbaGroup, Aug 4, 2014 IP
  6. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #6
    Doesn't read that way, it reads the OPPOSITE conclusion. Of course if you found that off-topic, you don't know the topic.

    Sounded like you were basically saying "go ahead and sleaze a bunch of anchors together inside it" -- that's not what it's for, nor is that semantic markup, nor is that good advice.

    But of course JHVH forbid someone post an actual explanation followed by logical arguments on why the very subject shouldn't even be an issue -- instead let's all do the twitter retard one-sentence wonder-**** routine that either doesn't say anything meaningful, is so misleading it's hard to figure out what's even being said, or worse, is easily interpreted as the opposite of what you meant.

    TLDR FTMFW --NOT!
     
    deathshadow, Aug 4, 2014 IP