Javascript Reference
Categories: STYLE

javascript STYLE borderBottom, borderLeft, borderRight, borderTop

@Aug. 17, 2009, 8:37 a.m.
borderBottom, borderLeft, borderRight, borderTop Firefox/Netscape/NN 6 IE 4 Chrome/Safari/DOM 2  

 

Read/Write  

These are shorthand properties for getting or setting the borderColor, borderStyle, and/or borderWidth properties for a single edge of an element in one statement. You must specify a border style (see borderStyle) for changes of these properties to affect the display of the element's border (a missing style is interpreted as no style, ergo no border along the specified edge). If you want all four edges to be the same, see the border attribute. 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. Available in IE as properties of the style and runtimeStyle objects only.

 
Example
 
document.getElementById("announce").style.borderBottom = "inset red 4px";
document.getElementById("announce").style.borderLeft = "solid #20ff00 2px";
document.getElementById("announce").style.borderRight = "double 3px";
document.getElementById("announce").style.borderTop = "outset red 8px";
 
Value

Space-delimited string. 

 
Default

None.


Powered by Linode.