Example: Styling borders
In this example, all declarations have the same specificity, which means that the priority is determined solely by their placement.
We can make use of the multiple properties for borders in order to, for example, have one side styled differently from the rest of the sides by first styling all the borders and then giving the style for the exceptional case.
Since the declaration for the exceptional case comes after the general declaration, it has priority.
Note:
Hints:
- undefined
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
<!DOCTYPE html>
<html lang="en">
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
p {
margin: 2rem;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX