CSS Properties: How to set the style of the left border?
Solution:
HTML Code:
Explanation:
- This HTML document demonstrates how to set different styles for the left border of h1 elements using CSS classes.
- Each h1 element has a common style with a solid border and a width of 3 pixels.
- Additional CSS classes are defined to specify different styles for the left border:
- none: No left border
- dotted: Dotted left border
- dashed: Dashed left border
- solid: Solid left border
- double: Double left border
- groove: Groove left border
- ridge: Ridge left border
- inset: Inset left border
- outset: Outset left border
- Each h1 element is assigned one of these classes to apply the corresponding left border style.
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.