Div, Section or Article - Which to use?

0800 156 0777

Div, Section or Article - Which to use?

Are you still using divs or do you use sections or articles? If you are still using divs to organise your content, then in my personal opinion you should start changing and use articles and sections. One of the most difficult things to organise is your structure, your content. I'm not talking about the styling, but how it is organised.

This is the main point of doing away with many of the divs that you used to have to put in. If you use divs everywhere, you cannot tell what belongs where. You have to add ids and classes to clarify the structure, never mind creating your styling. However with the correct nesting the structure becomes self-evident, reducing your need for divs and also reducing your need for creating a specific id or class. You will of course still need proper styling for your page, but the rules will not need so many ids and classes, they will just run from the existing structure that you create.

Personally I prefer sections, with articles inside. But there is no problem with the reverse. Essentially they are almost same, I just prefer sections with articles inside.

The point of using sections and artilces is to clarify your content structure. I will still add ids and classes where necessary, but if you structure your html right, you will need fewer ids and classes. If you organise your content properly and your css, you will be able to move your sections around and the styling will take care of itself.

Also, always check your document outline, so that you are producing a nice and logical structure.

So which do you use?