Easy Tutorial
❮ Pr Text Text Decoration Func Counter ❯

CSS border-style Property

Example

Set the style for all four borders:

p {
    border-style: solid;
}

Property Definition and Usage

The border-style property sets the style of an element's four borders. This property can have from one to four values.

Examples:

border-style: dotted solid double dashed;

border-style: dotted solid double;

border-style: dotted solid;

border-style: dotted;

Default value: not specified
Inherited: no
Version: CSS1
JavaScript syntax: object.style.borderStyle="dotted double"

Browser Support

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

Property
border-style 1.0 4.0 1.0 1.0 3.5

Property Values

Value Description
none Defines no border.
hidden Same as "none", except in border conflict resolution for table elements.
dotted Defines a dotted border.
dashed Defines a dashed border.
solid Defines a solid border.
double Defines a double border.
groove Defines a 3D grooved border.
ridge Defines a 3D ridged border.
inset Defines a 3D inset border.
outset Defines a 3D outset border.
inherit Specifies that the border style should be inherited from the parent element.

Live Example

Set Different Borders on Each Side


Related Articles

CSS Tutorial: CSS Border

❮ Pr Text Text Decoration Func Counter ❯