Easy Tutorial
❮ Css3 Pr Text Decoration Color Css3 Pr Transition ❯

CSS border-top Property

Example

Set the style of the top border:


Property Definition and Usage

The border-top shorthand property sets all the top border properties in one declaration.

It can be set in the following order: border-top-width, border-top-style, and border-top-color.

If any value is not set, it will not cause any issues; for example, border-top: solid #ff0000; is also allowed.

Default value: not specified
Inherited: no
--- ---
Version: CSS1
--- ---
JavaScript syntax: object.style.borderTop="3px solid blue"
--- ---

Browser Support

The numbers in the table specify the first browser version that fully supports the property.

Property
border-top 1.0 4.0 1.0 1.0 3.5

Property Values

Value Description
border-top-width Specifies the width of the top border. See: border-top-width
border-top-style Specifies the style of the top border. See: border-top-style
border-top-color Specifies the color of the top border. See: border-top-color
inherit Specifies that the border-top properties should be inherited from the parent element.

Related Articles

CSS Tutorial: CSS Border

❮ Css3 Pr Text Decoration Color Css3 Pr Transition ❯