Latest web development tutorials

HTML DOM Style borderTopStyle property

Style Object Reference Style Objects

Definition and Usage

borderTopStyle property sets or returns the border style elements.

grammar

Setting borderTopStyle properties:

Object.style.borderTopStyle="value"

Back borderTopStyle properties:

Object.style.borderTopStyle

描述
none 默认。定义无边框。
hidden 与 "none" 相同。不过应用于表时除外,对于表,hidden 用于解决边框冲突。
dotted 定义点状边框。
dashed 定义虚线边框。
solid 定义实线边框。
double 定义双线边框。双线的宽度等于 border-width 的值。
groove 定义 3D 凹槽边框。其效果取决于 border-color 的值。
ridge 定义 3D 垄状边框。其效果取决于 border-color 的值。
inset 定义 3D inset 边框。其效果取决于 border-color 的值。
outset 定义 3D outset 边框。其效果取决于 border-color 的值。
inherit 上边框的样式从父元素继承。


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support borderTopStyle property.

Note: IE7 and earlier versions do not support the "inherit" value.IE8 only provides! DOCTYPE supported "inherit". IE9 support "inherit".


Examples

Examples

Change the border style:

<! DOCTYPE html>
<Html>
<Head>
<Meta charset = "utf-8">
<Title> This tutorial (w3big.com) </ title>
<Style type = "text / css">
# Ex1 {
border: 1px solid # FF0000;
}
</ Style>
<Script>
function displayResult () {
document.getElementById ( "ex1") style.borderTopStyle = "dotted".;
}
</ Script>
</ Head>
<Body>

<Div id = "ex1"> This is some text. </ Div>
<br>
<Button type = "button" onclick = "displayResult ()"> Modify the border style </ button>

</ Body>
</ Html>

try it"


Style Object Reference Style Objects