Name
border — NN n/a IE 4 CSS 1
Synopsis
Inherited: No
A shorthand attribute for setting the width, style, and/or color of all four borders around an element in one assignment statement. Whichever attributes you don’t explicitly set with this attribute assume their initial values. Numerous other attributes 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.
Due to differences in the way browsers define their default behavior
with regard to borders, every style sheet border
rule should include the width and style settings. Failure to specify
both attributes may result in the border not being seen in one
browser or the other.
CSS Syntax
border:border-width||border-style||color
Value
For the border-width and
border-style attribute values, see the
respective attributes in this chapter. For details on the
color value, see the section about colors
at the beginning of this chapter.
Initial Value
None.
Example
P {border: groove darkred 3px}Applies To
All elements (CSS); block and replaced elements (IE).
Object Model Reference
- IE
[window.]document.all.elementID.style.border
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access