CSS - border-top


Description:

Sets an element's top border; value is one or more of a color, a value for border-top-width, and a value for border-style

Possible Values:

Possible value is one or more of a color, a value for border-width, and a value for border-style.

Applies to:

All the HTML elements.

DOM Syntax:

object.style.borderTop="2px solid red";

Example:

The border-top property allows you to specify color, style, and width of top lines in one property:

Following is the example to show to use all the three properties into a single property.

<p style="border-top:4px solid red;">
This example is showing shorthand property for border-top.
</p>
     

This will produce following result:

This example is showing shorthand property for border-top.

 

 





Spacer Bottom Left Corner ImageBottom Right Corner Image
Valid XHTML 1.0 Strict  Valid CSS! Check the accessibility of this site according to U.S. Section 508