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): 
<border-top-color>
<border-top-style>
<border-top-width>
inherit

Description of values:

border-top-color
Specifies the color of the element's top border.
border-top-style
Specifies the style of the element's top border.
border-top-width
Specifies the width of the element's top border.
inherit
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:
<head>
    <style>
        .example {
            border-top: 1px solid blue;
        }
    </style>
</head>
<body>
    <div class="example">Border-top: 1px solid blue</div>
</body>
Did you find this example helpful? yes no

Supported by tags:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content