border-style
top
TOC
Collapse the table of content
Expand the table of content

border-style

Sets the style of the left, right, top, and bottom borders of the object.

Syntax

{ border-style: sStyle }

Possible values

sStyle

String that specifies or receives one of the following values:

none

Default. No border is drawn, regardless of any specified border-width.

dashed

Border is a dashed line.

dotted

Border is a dotted line.

double

Border is a double line drawn on top of the background of the object. The sum of the widths of the two single lines and the space between them equals the border-width value. The border width must be at least 3 pixels wide to draw a double border.

groove

3D groove is drawn in colors based on the value. The border-width property of the object must be specified for the style to render correctly.

inset

3D inset is drawn in colors based on the value.

outset

3D outset is drawn in colors based on the value.

ridge

3D ridge is drawn in colors based on the value.

solid

Border is a solid line.

window-inset

Border is the same as the inset, but is surrounded by an additional single line, drawn in colors based on the value.

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

Examples

The following example uses the border-style property to specify the border style. This example uses a call to an embedded (global) style sheet to change the style of the border to groove when an onmouseover event occurs:

<head><style>
    td { border-style: solid; border-width: 0.5cm; }
    .change { border-style: groove; }
</style>
</head>
<body>
<table border >
<tr>
    <td onmouseover="this.className='change '" onmouseout="this.className=''">
        <img src="sphere.jpg">
    </td>
</tr>
</table>

Standards information

This property is defined in Cascading Style Sheets (CSS), Level 1 (CSS1) Ee371285.xtlink_newWindow(en-us,Expression.40).png.

Applies to

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, HR, I, IFRAME, 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

See also

Send feedback about this topic to Microsoft. © 2011 Microsoft Corporation. All rights reserved.

Community Additions

ADD
Show:
© 2016 Microsoft