DEV Community

[Comment from a deleted post]
Collapse
 
joelbonetr profile image
JoelBonetR 🥇

Nice article! I've a question about semantically use classes to define unique wrappers on the layout.
I assume you will have only a "main-content" per view so why don't use an id instead on a global class?
You can use the same id on different views but nor repeating ids on the same, so you can attach the styling you want for being common on #main-content instead making it global using a class.
Ids Are useful to scope JavaScript and CSS being not applicable on a different scope and making it to run efficiently (and faster btw).