HTML and CSS Reference
In-Depth Information
border-top
This property defines in a shorthand form the width, style, and color for the top border of
an element.
Syntax
border-top: border-width border-style border-color;
where
border-width
sets the width of the top border as a positive numeric measurement
or using a named value of
thin
,
medium
, or
thick
. The second value,
border-style
, is
used to set the style of the top border and is set to a value of
dashed
,
dotted
,
double
,
groove
,
hidden
,
inset
,
none
,
outset
,
ridge
, or
solid
. Finally,
border-color
is used
to set the color of the top border using a CSS color value.
Example
#boxtop {border-top: thin solid blue;}
Compatibility
CSS 1, 2, 3
IE 4+
Netscape 6+, Firefox 1+
Opera 4+, Safari 1+
Note
• Given that CSS1 did not support
border-top-color
and
border-top-style
, this
property is useful for setting the characteristics of the right border of boxes for older
browsers.
border-top-color
This CSS2+ property defines the color of an element's top border.
Syntax
border-top-color:
color
| transparent | inherit
where
color
is a valid CSS color value.
Example
p {border-style: solid; border-width: thin; border-top-color: #f00;}
Compatibility
CSS 2, 3
IE 4+
Netscape 6+, Firefox 1+
Opera 4+, Safari 1+