EN
此内容没有您的语言版本,但有英语版本。

border-top-width property

Specifies the thickness of the top border of the object.

CSS Backgrounds and Borders Module Level 3, Section 4.3

Syntax

border-top-width: medium | thin | thick | <width>

Property values

medium

Initial value. The default thickness.

thin

Less than the default thickness.

thick

Greater than the default thickness.

width

Thickness specified by a floating-point number, followed by a supported length unit.

CSS information

Applies ToAll elements
Mediavisual
Inheritedno
Initial Valuemedium

Standards information

Examples

The following examples use the border-top-width CSS property and the borderTopWidth scripting property to specify the width of the top border.

This example uses a call to an embedded (global) style sheet to change the width of the top border to 1 centimeter when a mouse click occurs.

Code example: http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/border-top-width.htm


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

This example uses inline script to change the width of the top border to 1 centimeter when a mouse click occurs.


<td onclick="this.style.borderTopWidth='1cm'">

See also

CSSStyleDeclaration
currentStyle
defaults
runtimeStyle
style
Reference
border

 

 

显示:
© 2014 Microsoft