Jump to content

Bootstrap divs over HTML5 tags?


OAFC_Rob

Recommended Posts

Hi,

 

I've been looking at the Bootstrap 3 and various tutorials / example sites even from their own website. This has lead me to a question I cannot seem to find a quick answer to why do they use divs over the new HTML5 tags such as nav.

 

For example;

<div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
      <div class="container">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="navbar-brand" href="#">Project name</a>
        </div>
        <div class="collapse navbar-collapse">
          <ul class="nav navbar-nav">
            <li class="active"><a href="#">Home</a></li>
            <li><a href="#about">About</a></li>
            <li><a href="#contact">Contact</a></li>
          </ul>
        </div><!--/.nav-collapse -->
      </div>
    </div>

Comapred to something more like;

<div class="container">
   <nav>
      <ul>
           <li><a href="#"> Home </a></li>
      </ul>
   </nav>
</div>

I know these two examples don't match up in the slightest but I'm not looking for the synatx just an explaniation. Is it the fact that HTML5 is still the draft stages and IE doesn't handle nav to gracefully wihtout shiv etc...

 

Or is the developer of the examples is just a bit lazy and couldn't be bothered to swap it to the newer tags?

 

The reason I ask is I'm not too sure which way would be the best for developing a site using bootstrap.

 

Thanks in advance.

Link to comment
Share on other sites

The best people to ask would be, not surprisingly, the Bootstrap developers ;-)

 

I would suggest that it could be for backwards compatibility, as you note, or a sort of "laziness". Keep in mind that time equals money in business, at least ... it's not uncommon at all to see working software ship with "antiquated" code ;)

Link to comment
Share on other sites

The HTML5 tags do work and I've seen no major issues with using them as long as you've included shiv for backwards compat. But it does seem strange that their examples are technically using outdated methods, just seems odd to me.

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.