Openwave Mobile Browser 7.0: XHTML Mobile Profile and CSS Reference
Section 24 out of 38 total sections
Current chapter: CSS Reference

You can use the border properties to set the width, color, and pattern of a border. Elements have no border unless you set one with the border properties or an XHTML-MP attribute.
Borders are described in The CSS Box Model.

Sets the width of the top, right, bottom, or left border.
em, ex, cm, mm, in, pt, pc, px, inherit, thin, medium, thick
For more information, see Units of Measure and Keywords.
Block elements and replaced inline elements (such as <img> and <object>).
You must set a border-style property to solid to display a border; setting the width alone is not sufficient.
table {border-top-width: 2px; border-left-width: 4px; border-style: solid}
Sets a 2-pixel top border and a 4-pixel left border for all tables.

A shorthand property for setting the width of all four borders: all at once, in sets, or individually, as described in The CSS Box Model.
em, ex, cm, mm, in, pt, pc, px, inherit, thin, medium, thick
For more information, see Units of Measure and Keywords.
See the individual border properties.
Block elements and replaced inline elements (such as <img> and <object>).
You must set a border-style property to solid to display a border; setting the width alone is not sufficient.
table {border: 4px 2px; border-style: solid}
Sets a 4-pixel top and bottom border and a 2-pixel right and left border for all tables.

Sets the color of the top, right, bottom, or left border.
See Colors.
The current foreground color of the element.
Block elements and replaced inline elements (such as <img> and <object>).
You must set a border-style property to solid to display a border; setting the color alone is not sufficient.
table {border-top-color: red; border-left-color: green}
Sets the top borders to red and left borders to green for all tables.

A shorthand property for setting the color of all four borders: all at once, in sets, or individually, as described in The CSS Box Model.
See Colors.
The current foreground color of the element.
Block elements and replaced inline elements (such as <img> and <object>).
You must set a border-style property to solid to display a border; setting the color alone is not sufficient.
table {border-color: red green; border-style: solid}
Sets the top and bottom borders of tables to green and their right and left borders to red.

Sets the style of the top, right, bottom, or left border.
Block elements and replaced inline elements (such as <img> and <object>).
Unless you set a border's style to solid, other border settings have no visible effect.
Hidden borders have no width, that is, they're not merely transparent or invisible. Irrespective of their other properties, they are ignored by the browser.
For a discussion of the difference between the none and hidden keywords, see section 17.6.2, "The Collapsing Border Model," in the W3C CSS2 specification.
table {border-top-style: solid}
Sets the top borders of all tables to a solid line.

A shorthand property for setting the style of all four borders: all at once, in sets, or individually, as described in The CSS Box Model.
See the individual border style properties.
Block elements and replaced inline elements (such as <img> and <object>).
Sets all borders of all tables to a solid line.

Shorthand properties for setting the width, color, and style of the top, right, bottom, or left border.
See the values for border-width, border-color, and border-style.
Block elements and replaced inline elements (such as <img> and <object>).
Because they share no common values, you can use the width, color, and style values in any order.
table {border-top: thick solid green}
Sets the top borders of all tables to a thick solid green line.

A shorthand property for setting the width, color, and style of all four borders.
See the values for border-width, border-color, and border-style.
See the individual border properties.
Block elements and replaced inline elements (such as <img> and <object>).
Because they share no common values, you can use the width, color, and style values in any order.
table {border: thin solid red}
Sets all borders of all tables to a thin solid red line.

