Export (0) Print
Expand All

border

Sets the properties to draw around the object.

{ border: sBorder }

sBorder

String that specifies or receives one or more of the following space-delimited values:

color

Any of the range of color values available to the border-color property.

style

Any of the range of style values available to the border-style property. The default value is none.

width

Any of the range of width values available to the border-width property. The default value is medium.

This property has a default value of medium none. It is not inherited.

The border property is a composite property that sets the width, style, and color values for all four sides of an object.

You must specify a style when specifying a width or color; otherwise, the border does not render.

All individual border properties not set by the composite border property are set to their default values. For example, the default value for width is medium.

The setting border=thin is identical to border=thin none; the default value for the border color is the same as the text color if one is not initially set. So, not only does the property set width to thin, but it also clears any style or color values that were previously set.

If a color is not specified, the text color is used.

The following example uses the border property to specify the composite border properties. This example uses a call to an embedded (global) style sheet to modify the border property:

<head><style>
    .applyborder { border: 0.2cm groove orange; }
    .removeborder { border: none; }
</style>
</head>
<body>
<table border >
<tr> 
    <td onmouseover="this.className='applyborder '" onmouseout="this.className='removeborder '">
    <img src="sphere.jpg"></td>
</tr>
</table>

A, ABBR, ACRONYM, B, BDO, BIG, BLOCKQUOTE, BODY, BUTTON, CAPTION, CENTER, CITE, CODE, CUSTOM, DD, DEFAULTS, DEL, DFN, DIV, DL, DT, EM, EMBED, FIELDSET, FONT, FORM, FRAME, HN, I, IMG, INPUT TYPE=BUTTON, INPUT TYPE=CHECKBOX, INPUT TYPE=FILE, INPUT TYPE=IMAGE, INPUT TYPE=PASSWORD, INPUT TYPE=RADIO, INPUT TYPE=RESET, INPUT TYPE=SUBMIT, INPUT TYPE=TEXT, INS, LI, OBJECT, OL, P, Q, S, SPAN, SUB, TABLE, TD, TH, TT, U, UL, VAR, XMP

Community Additions

ADD
Show:
© 2014 Microsoft