This class selector will match every element which has a certain class.
# Syntax
Copy
.classname {
/* declarations */
}
# Example
Copy
.alert {
border: 1px solid red;
background-color: pink;
}
In this example will every element with the class of alert
will get a red border with an pink background.
# Browser support
Platform
Chrome
Firefox
Safari
Edge
Internet Explorer
Opera
Desktop
Yes (1.0)
Yes (1.0)
Yes (1.0)
Yes (12.0)
Yes (3.0)
Yes (2.0)
Mobile
Yes (1.0)
Yes (1.0)
Yes (1.0)
Yes (12.0)
Yes (3.0)
Yes (2.0)
Please wait a moment, the comments start loading now...