Name

border — NN n/a IE 4 DOM n/a

Synopsis

Read/Write

A shorthand property for getting or setting the borderColor, borderStyle, and/or borderWidth properties of all four borders around an element in one statement. You must specify a border style (see borderStyle) for changes of this property to affect the display of the element’s border. Numerous other properties allow you to set the width, style, and color of individual edges or groups of edges if you don’t want all four edges to be the same. Only those component settings explicitly made in the element’s tag attributes are reflected in the property, but you may assign components not part of the original tag.

Example

document.all.announce.style.border = "inset red 4px"

Value

For the borderStyle and borderWidth component values, see the respective properties in this chapter. For details on the borderColor value, see the section about colors at the beginning of this chapter.

Default

None.

Get Dynamic HTML: The Definitive Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.