Streaming live at 10am (PST)

Is there a way to create global classes for styles

Is there a way to create global classes to apply styles to any HTML element?

For e.g., I want to create a class to apply Blue color to any HTML element’s background. I would create the following class if I’m coding in HTML & CSS.
.background-blue {background-color: Blue;}

If I want to set the White color to text, I would create below following.
.text-white {color: White;}

You will need many classes if you do it in such small steps but it is possible.

Element A: (.background-blue,.text-white,.extraclass1)
Element B: (.background-blue,.text-white,.extraclass2)

W3Schools - Classsystem

@Matzinger
What I’m saying is this. https://jsfiddle.net/n0g45j1a/
I think it’s not necessary to create separate classes for different HTML elements to apply styles like text color, background color.

Just create a class, style it the way you want, then apply this class to any element afterwards. You may keep the global classes you create on some auxiliary page to avoid deleting them (if they are not in use) by the clean class feature.

@dram Hmm… I thought of creating a separate page which will only have all the global classes.

1 Like

And that’s exactly my suggestion :slight_smile:

1 Like