6 Replies - 1044 Views - Last Post: 23 February 2013 - 06:10 AM

#1 josefroyadvincula  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 23-December 12

Are <ul>s Inside HTML5 <nav>s legit?

Posted 19 February 2013 - 11:37 PM

This is just a quickie. I've seen people use uls inside nav tags, but I've also seen others that don't. Everytime I try to make one, merely deciding whether I need the <ul>s inside my <nav> drives me crazy. Is there a standard for this or is it just a matter of personal preference?
Is This A Good Question/Topic? 0
  • +

Replies To: Are <ul>s Inside HTML5 <nav>s legit?

#2 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3480
  • View blog
  • Posts: 10,028
  • Joined: 08-June 10

Re: Are <ul>s Inside HTML5 <nav>s legit?

Posted 19 February 2013 - 11:40 PM

thatís a matter of the navigation used. often the navigation is based on lists, hence <ul> (e.g. the Suckerfish Dropdown)
Was This Post Helpful? 0
  • +
  • -

#3 josefroyadvincula  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 23-December 12

Re: Are <ul>s Inside HTML5 <nav>s legit?

Posted 20 February 2013 - 01:08 AM

Well, yes, they are indeed based on lists. But the <a>s on the <nav> are already, well, within the <nav>. Isn't that enough to mean, 'hey, this part is the navigation menu and these are the links'? I mean, you wouldn't put <article>s in a <section> inside a <ul>.

Okay, did I just confuse everybody with what I said? lol
Was This Post Helpful? 0
  • +
  • -

#4 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3480
  • View blog
  • Posts: 10,028
  • Joined: 08-June 10

Re: Are <ul>s Inside HTML5 <nav>s legit?

Posted 20 February 2013 - 02:40 AM

View Postjosefroyadvincula, on 20 February 2013 - 09:08 AM, said:

Okay, did I just confuse everybody with what I said?

yes.

the problem is, if you use a list (well, a navigation *is* a list, semantically) you need <ul>. and with <a>s alone you canít make a multi-level navigation/dropdown.
Was This Post Helpful? 0
  • +
  • -

#5 josefroyadvincula  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 23-December 12

Re: Are <ul>s Inside HTML5 <nav>s legit?

Posted 20 February 2013 - 04:40 AM

Hmmm... Good point there... Thanks!
Was This Post Helpful? 0
  • +
  • -

#6 FerretHolmes  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 41
  • View blog
  • Posts: 167
  • Joined: 12-November 12

Re: Are <ul>s Inside HTML5 <nav>s legit?

Posted 20 February 2013 - 02:17 PM

I feel like the OP is just confused on the use of <nav>.

Nav in html5 is just like any other element. You can style it with css like you would anything else.
<nav>
  <ul>
   <li></li>
  </ul>
</nav>


.. is the same thing as
<div id="nav">
    <ul>
      <li></li>
    </ul>
</div>


The real differences and reasons for using nav instead of a div, is really for structure and the use of screen readers. You can use nav more than once in a page, but you should really keep it limited to only major navigation groups. Breadcrumbs, menu's, etc.
If this is not what you were confused about then just ignore me. :balloon:
Was This Post Helpful? 0
  • +
  • -

#7 FrankC  Icon User is offline

  • New D.I.C Head

Reputation: 3
  • View blog
  • Posts: 45
  • Joined: 06-October 11

Re: Are <ul>s Inside HTML5 <nav>s legit?

Posted 23 February 2013 - 06:10 AM

I think the OP should also know that the basic rule in HTML/CSS is that you can put inline elements inside all other elements, block elements inside block elements, but not block elements inside inline elements. <nav> and <ul> are both block elements, so there is no problem there.

For more information, see the tutorial How to Position in CSS.

This post has been edited by FrankC: 23 February 2013 - 06:11 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1