Before proceeding to CSS class selector, I’ll advice you to read CSS tutorial for beginners, CSS Properties and Values and CSS Selectors first. If you have already read, then we’re good to proceed.
Introduction to css class selector
A class in CSS can be explained as a category in which different elements have same styling. Didn’t get it? Okay,
Suppose we have a Usage:
this is paragraph text
this is any other paragraph text.
and our CSS we can see the result : See the Pen Css Class by The SuperKat (@thesuperkat) on CodePen. So as we see in the example above, we have three elements with class “red-color”. So we specified styling for .red-color class in the CSS and BINGO! , all the HTML Elements with class “red-color” attribute have red colored text now. Guess What? : you can specify multiple classes for the same element. Yes! you can by separating two classes with space. For example: and this will style Hello in red color and with yellow background. That’s pretty much about you need to know for starters about CSS Class selector. Because all at once is nothing at end. So take out your inner demon of creativity and do something mind blowing already. Next Step : CSS element selector Related Links : The post Css Class Selector appeared first on The Superkat.
this is h4 text
.red-color{
color:red;
}
.red-color{
color:red;
}
.yellow-background{
background:yellow;
}