DEV Community

Discussion on: (Bootstrap) Am I missing something here...?

Collapse
 
mastacheata profile image
Mastacheata

The benefit of classes over applying a style to every element type is that you're now able to have different looking things that use the same HTML elements.

For example you might want to use a list for a left-hand menu and another one for a top or bottom menu, but they're obviously not supposed to look the same.

Bootstrap takes a very expressive approach by pretty much skipping inheritance completely and assigning a class to every element.
Other CSS Frameworks will have classes that apply a certain style to all nested elements.
For example UIKit (the CSS Framework, not the Apple UI one), provides you with a uk-child-width-1-3 class that makes all directly nested elements take up one third of their parent's width unless they have their own class or styling.

Collapse
 
javascriptcoff1 profile image
JavaScript➕Coffee🚀

This makes sense, and is very true. Thank you!