T
21

The way most beginners structure their HTML is making me crazy

I've been helping out in a local coding meetup for about 6 months now and I keep seeing the same mistake over and over. People are wrapping everything in divs instead of using semantic tags like header, main, and footer. It's not just about being neat. If you build a page with 40 nested divs, screen readers can't navigate it and Google has a harder time figuring out what's important. Last week a guy showed me his portfolio site and every section was just div class=container, div class=inner, div class=wrapper. I told him to swap three of those for section and article tags and he said it looked cleaner in 5 minutes. Why do so many tutorials teach the div approach instead of proper structure? Has anyone else noticed this pattern holding people back?
2 comments

Log in to join the discussion

Log In
2 Comments
ericjackson
Yeah but does it really matter that much in practice? A beginner building their first portfolio site isn't worried about Google rankings or screen reader users, they just want something that works and looks okay. All those divs with class names actually make it easier for newbies to understand the box model and CSS layout stuff without getting confused by special tags. You're acting like 40 nested divs is a crime but most personal sites get like 50 visitors a month and nobody's running accessibility audits on them.
1
faithrodriguez
When I was learning, all those divs and class names actually helped things click for me way better than semantic tags would have. Once I got comfortable with the box model and basic layout stuff, switching to proper HTML structure felt a lot more natural because I understood the underlying rules first. It's great you're thinking about this from a beginner's perspective, I think the priority should be getting them to build something that works and makes sense to them before worrying about the more advanced stuff.
5