CSS Properties: How to set the color of the four borders?
Solution:
HTML Code:
Explanation:
- This HTML document demonstrates different ways to set the color of borders using CSS.
- Four different classes (xyz, xyz1, xyz2, xyz3) are defined, each with a different border color.
- border-style: solid; sets the border style to solid for all classes.
- border-color property sets the color of the borders.
- Different combinations of colors (hexadecimal, rgb) are used to define border colors for each class.
Live Demo:
See the solution in the browser
Supported browser
![]() |
![]() |
![]() |
![]() |
![]() |
Yes | Yes | Yes | Yes | Yes |
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.