CSS3 > Borders

Border-top-color Property in CSS3

How to set the color to the top border of an element in CSS3?


By using border-top-color property we can set the color to the top border of an element.

<style>
        p {
            border-style: solid;
            border-top-color: red;
        }

        div {
            border-style: double;
            border-top-color: blue;
        }
</style>

<body>
    <p>This element having red color border at the top side.</p>
    <div>This element having blue color border at the top side.</div>
</body>

In the above code snippet we have given border-top-color property with different values to the <p> element and <div> element. The border-top-color property with value "red" is applied to the <p> element, so that the top border color of <p> element will appear in red color. The border-top-color property with value "blue" is applied to the <div> element, so that the top border color of <div> element will appear in blue color.

OUTPUT

 

 Views: 3298 | Post Order: 67



Write for us






Hosting Recommendations