Latest web development tutorials

HTML DOM Style borderBottom property

Style Object Reference Style Objects

Definition and Usage

borderBottom shorthand property to set or return at three separate border properties.

With this property, you can set / return:

  • border-bottom-width
  • border-bottom-style
  • border-bottom-color

grammar

Setting borderBottom properties:

Object.style.borderBottom="width style color"

Back borderBottom properties:

Object.style.borderBottom

Tip: borderBottom property has no default value.

参数 描述
width 设置下边框的宽度。
style 设置下边框的样式。
color 设置下边框的颜色。


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support borderBottom property.


Examples

Examples

Change the width, style, and color at the border:

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

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

</ Body>
</ Html>

try it"


Style Object Reference Style Objects