Style border property
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:
- border-width
- border-style
- border-color
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





All major browsers support the border property.
Example
Example
Change the border of a div element:
This is some text.
Try it »
The Style object