HTML and CSS Reference
In-Depth Information
padding: 2em; /* shorthand: all sides */
padding: 2em 0; /* shorthand: top & bottom; right & left */
padding: 2em 0 1em; /* shorthand: top; right & left; bottom */
padding: 2em 0 1em 10px; /* shorthand: top; right; bottom;
left */
The
border-width
property sets the size of an element's border.
■
<length>
: The border width will be a fixed dimension.
■
thin
|
medium
|
thick
: The border width is designated by keywords
representing three border lengths of progressive thickness (not often
used because of the inconsistency in definition of actual dimensions).
The
border-width
property defines the width of the border on an
element. Like
margin
and
padding
,
border-width
is a shortcut for defin-
ing the four individual sides independently and can take one to four
values.
border-top-width: 2px;
border-right-width: 0;
border-bottom-width: 10px;
border-left-width: 1px;
border-width: 2px 0 10px 1px; /* shorthand: top; right;
bottom; left */
In Chapter 8, I discuss some of the visual options for borders in detail, but
only
border-width
impacts the dimensions of an element.