CSS Properties: How to set the style of the right border?
Solution:
HTML Code:
Explanation:
- The HTML document is structured with essential elements such as html, head, title, style, and body.
- CSS is used to style all h1 elements, setting their border style to solid and border width to 3 pixels.
- Additional CSS rules are defined for specific classes of h1 elements to set the style of their right border:
- h1.none sets the right border style to none.
- h1.dotted sets the right border style to dotted.
- h1.dashed sets the right border style to dashed.
- h1.solid sets the right border style to solid.
- h1.double sets the right border style to double.
- h1.groove sets the right border style to groove.
- h1.ridge sets the right border style to ridge.
- h1.inset sets the right border style to inset.
- h1.outset sets the right border style to outset.
- Each h1 element is given a class corresponding to the desired right border style, and the text inside each h1 element reflects the border style it demonstrates.
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.