Section Semantics

For me, I’m not wholly sure why you’d want to have a div inside a section, then apply a container class to it. You can already apply your styling to the section, and vary that by class if you need to. I’d want to keep the code much cleaner, something like this.

<section>
  <h1>Title</h1>
  <p>Some content</p>
  <p>Some more content</p>
  <p>Yet more content</p>
</section>

With that, you improve your semantics, your accessibility, reduce the div’itis, and in all likelihood reduce the amount of CSS you need too. It’s also more readable to you the coder too.

2 Likes