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

HTML DOM Style border property

Style border property

Style Object Reference The Style object


Definition and Usage

The border property sets or returns three separate border properties in shorthand form.

With this property, you can set/return:

Syntax

Set the border property:

Object.style.border="

width style color

"

Return the border property:

Object.style.border

**Tip:** The border property has no default value.

Parameters Description
width Sets the width of the border.
style Sets the style of the border.
color Sets the color of the border.

Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the border property.


Example

Example

Change the border of a div element:

Runoob Tutorial(runoob.com)
This is some text.

Try it »


Style Object Reference The Style object