CSS CSS Layout Basics Getting Started with CSS Layout Centering Page Content and Creating a Full-width Header

Alejandro Udinov
Alejandro Udinov
727 Points

Why can't /couldn't .main-header or header be used as a wrapper for header section, semantically speaking ?

instead of using <div> to divide the content into three logical containers couldn't we use the semantically logical tags <header> and <footer> as containers for layout design ? Do we really need to add <div> containers ?

1 Answer

Jamie Reardon
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Jamie Reardon
Treehouse Project Reviewer

Developers tend to commonly use divs as wrappers/containers for page elements. You can use and should use other elements that will provide your site with semanitic meaningful content, but the likes of giving a container/wrapper in this case those kind of tags, wouldn't really give a sense of the semantic purpose here. The section tag is a semantic html5 markup element that is an appropriate method for replacing div tags where suitable.