Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Style borderStyle property

Style borderStyle Property

Style Object Reference The Style object


Definition and Usage

The borderStyle property sets or returns the style of an element's border.

This property can use 1 to 4 styles:

Syntax

Set the borderStyle property:

Object.style.borderStyle="

value

"

Return the borderStyle property:

Object.style.borderStyle

Value Description
none Default. Defines no border.
hidden Same as "none". Except when applied to tables, where hidden is used to resolve border conflicts.
dotted Defines a dotted border.
dashed Defines a dashed border.
solid Defines a solid border.
double Defines a double border. The width of the double line equals the value of border-width.
groove Defines a 3D grooved border. Its effect depends on the value of border-color.
ridge Defines a 3D ridged border. Its effect depends on the value of border-color.
inset Defines a 3D inset border. Its effect depends on the value of border-color.
outset Defines a 3D outset border. Its effect depends on the value of border-color.
inherit The border style is inherited from the parent element.

Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the borderStyle property.

**Note:** IE7 and earlier versions do not support the "inherit" value. IE8 supports "inherit" only if a !DOCTYPE is specified. IE9 supports "inherit".


Example

Example

Change the style of the four borders:

This is some text.

Try it »


Style Object Reference The Style object