The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS CSS styling which way is better Reply To: CSS styling which way is better


Firstly…don’t do this:

.color-white {
color: white;

Class names shouldn’t be that specific…what if you decide to change the color to red...color-white doesn’t make a lot of sense then.

As for what’s best…that’s entirely up to you…there are whole books on naming schemes and conventions…BEM, SMACCS etc.

If your CSS selector is specific (enough) you often don’t need a class at all.