Style borderBottom 属性

定义和用法

borderBottom Properties are set or returned in a shorthand form, up to three separate border-bottom properties.

With this property, you can set/return the following one or more (in any order):

See Also:

CSS Tutorial:CSS Border

CSS Reference Manual:border-bottom Property

HTML DOM Reference Manual:border Property

Example

Example 1

Add a bottom border to the <div> element:

document.getElementById("myDiv").style.borderBottom = "thick solid #0000FF";

Try It Yourself

Example 2

Change the width, style, and color of the border-bottom of the <div> element:

document.getElementById("myDiv").style.borderBottom = "thin dotted red";

Try It Yourself

Example 3

Return the border-bottom property value of the <div> element:

alert(document.getElementById("myDiv").style.borderBottom);

Try It Yourself

Syntax

Return borderBottom property:

object.style.borderBottom

Set borderBottom property:

object.style.borderBottom = "width style color|initial|inherit"

Attribute Value

Value Description
width Set the width of the bottom border.
style Set the style of the bottom border.
color Set the color of the bottom border.
initial Set this property to its default value. See initial.
inherit Inherit this property from its parent element. See inherit.

Technical Details

Default Value: not specified
Return Value: A string representing the width, style, and/or color of the element's bottom border.
CSS Version: CSS1

Browser Support

The numbers in the table indicate the first browser version to fully support this property.

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
1.0 4.0 1.0 1.0 3.5