Are we still using DIV?

Good Day All,
whilst in a lesson, I noticed that it’s preferred that we use NAV, HEADER, etc… instead of DIV. Coming into development as a total rookie, I was initially taught that we use DIV with an attribute as a container for almost everything. Was I miss informed? or did I misunderstand? can someone shed light on this for me, thanks.

Hello @archerknightneeyork, welcome to the forums! It is preferred to use semantic tags (like <nav, etc), in their correct places. If you’re creating a nav bar, then I’d suggest to use <nav>. Similarly, if you’re creating a header, use the <header> tag. If; however, you want to put various elements in a container with no better semantic tag, then you can use <div>. In short, if you’re unsure about the tag, use <div; there’s nothing wrong with it.

I hope this helps!


This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.