Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS Framework Basics Build a Website with Bootstrap Content Layout with Grids

SERGIO RODRIGUEZ
SERGIO RODRIGUEZ
17,532 Points

Are all divs used to insert images from css considered non-semantic divs?

By using bootstrap we are forced to used A LOT of divs for styling. Among those, we use a lot of empty divs to place images using CSS.

Aren't those considered non-semantic? Will they have any negative impact on SEO?

1 Answer

Christian Lawrence
Christian Lawrence
3,941 Points

TL;DR It's ok to still be using divs, but the more semantic your code is the better for SEO ect.

Bootstrap examples aren't particularly good at defining HTML semantics, but then semantics are all about what the content is inside, so you should be changing some yourself anyway.

I think the reason there are a lot of divs is so it's a flexible and robust as possible across browser. Build from scratch will always be the optimal solution, but it usually comes down to a matter of budget and time. Personally I prefer the Foundation framework, however that requires a bit more set-up.