Learn HTML5, Using divs in html5

You may have noticed that up until now we haven’t used a single div on our page Now this is in stark contrast to HTML4 and XTHML documents where divs are the primary way to group and organize content.

That’s not the case anymore, as the variety and richness of the sectioning and grouping elements in HTML5, means that we don’t really have to rely on the div tag to do all the heavy lifting for us Of course, this doesn’t mean that we’re just gonna forget about the div and never use it anymore There are some very legitimate reasons for using it.

So I wanna take a quick look at what the specification has to say about the div and then come back into our page and see where it might work for us.

So, I’m in the W3C HTML file specification I have jumped down to the div element And this is where it gets kinda sad Number one, first off, notice that it’s content model is flow content and it can pretty much contain anything you want it to contain But this is where it gets kinda sad Read the description here “The div element has no special meaning at all.

Leave a Reply

avatar
1000
  Subscribe  
Notify of