border-top-width

設定物件的框線寬度。

語法

{ border-top-width: sWidth }

可能的值

sWidth

指定下列其中一個值的變數:

medium

預設值。

thick

大於預設寬度。

thin

小於預設寬度。

width

浮點數,後面接著絕對單位指示項 ( cmmminptpc ) 或相對單位指示項 ( emexpx )。

如需支援之長度單位的詳細資訊,請參閱長度單位參照

此屬性的預設值為 medium 。這不是繼承屬性。

範例

下列範例使用 border-top-width 屬性來指定框線寬度。此範例會呼叫內嵌 (全域) 樣式表,以在發生滑鼠點選事件時,將下框線的寬度變成 1 公分:

<head><style>
    td { border-top-width: 3mm; }
    .changeborder 1 { border-top-width: 1cm; }
</style>
</head>
<body>
<table border >
<tr>
    <td onclick="this.className='changeborder 1'" ondblclick="this.className=''">
        <img src="sphere.jpg">
    </td>
</tr>
</table>

標準資訊

您可以在 Cascading Style Sheets (CSS), Level 1 (CSS1) (階層式樣式表 (CSS) 層級 1 (CSS1)) Ee371200.xtlink_newWindow(zh-tw,Expression.40).png 找到此屬性的定義。

適用範圍

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

另請參閱

概念

border
border-top
border-width