định dạng các thuộc tính CSS
}
For example:
.quantrimang {
background-color: black;
color: white;
font-size: 20px;
To define HTML elements by class name, we use class="ten_class"
.
For example:
Website TipsMake.com
Note :
_
, hyphens -
. Class name should not start with numbers.Example 1: Select and style all elements with class = "intro":
.intro {
background-color: #58257b;
color: white;
}
Result:
Full code:
Category Technology Village.
Technology
Introducing TipsMake.com
Example 2: Style all elements
with class = "hometown" (only applicable for
)
p.hometown {
background: #58257b;
color: white;
}
Full code:
Category Technology Village
Technology category
Science Category
Application category
Example 3: An element can have multiple classes
The element has two combined classes
This paragraph will be centered and red
This paragraph will be centered, red and size
Very big font
See more: