CSS Properties: How to specify the color of the top border?
Solution:
HTML Code:
Explanation:
- The HTML document structure includes essential elements such as html, head, title, style, and body.
- A CSS rule is defined for h1 elements, specifying the border style as solid.
- The border-top-color property is used to set the color of the top border of the h1 element to green.
- The text "w3resource Tutorial" is displayed within an h1 element.
- No comments were added below the code line as requested.
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.
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics