Latest web development tutorials

HTML DOM Style borderTopColor property

Style Object Reference Style Objects

Definition and Usage

borderTopColor property sets or returns the color of the element on the border.

grammar

Setting borderTopColor properties:

Object.style.borderTopColor="color|transparent|inherit"

Back borderTopColor properties:

Object.style.borderTopColor

Tip: borderTopColor property has no default value.

描述
color 规定上边框的颜色。在 CSS 颜色值 中寻找可能的颜色值的完整列表。
transparent 上边框的颜色是透明的(基本内容将会穿透)。
inherit 上边框的颜色从父元素继承。


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support borderTopColor 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 color of the border:

<! 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.borderTopColor = "# 00FF00";
}
</ Script>
</ Head>
<Body>

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

</ Body>
</ Html>

try it"


Style Object Reference Style Objects