You are here: Reference > CSS > properties > border-top

border-top property

Browser support:
Specifies the color, style and width properties for the element's top border, in a shorthand form.
Available border styles:

border-top-style: dotted
border-top-style: dashed
border-top-style: solid
border-top-style: double
border-top-style: inset
border-top-style: outset
border-top-style: groove
border-top-style: ridge
border-top-style: window-inset

JavaScript page for this property: borderTop. You can find other example(s) there.

Possible values:

 One of the following values: 
 Any of the following values (use the space character to separate them, each value can be used only once): 

Description of values:

Specifies the color of the element's top border.
Specifies the style of the element's top border.
Specifies the width of the element's top border.
Takes the value of this property from the computed style of the parent element.
Default: this property has no default value.

Example HTML code 1:

This example illustrates the use of the border-top property:
        .example {
            border-top: 1px solid blue;
    <div class="example">Border-top: 1px solid blue</div>
Did you find this example helpful? yes no

Supported by tags:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content