OAFC_Rob Posted June 3, 2014 Share Posted June 3, 2014 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. Quote Link to comment https://forums.phpfreaks.com/topic/288956-bootstrap-divs-over-html5-tags/ Share on other sites More sharing options...
dalecosp Posted June 3, 2014 Share Posted June 3, 2014 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 Quote Link to comment https://forums.phpfreaks.com/topic/288956-bootstrap-divs-over-html5-tags/#findComment-1481761 Share on other sites More sharing options...
OAFC_Rob Posted June 3, 2014 Author Share Posted June 3, 2014 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. Quote Link to comment https://forums.phpfreaks.com/topic/288956-bootstrap-divs-over-html5-tags/#findComment-1481769 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.