borderBottom Property - Javascript CSS Style Property

Javascript examples for CSS Style Property:borderBottom

Description

The borderBottom property sets or gets three border-bottom properties:

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

Property Values

Parameter Description
width Sets the width of the bottom border
style Sets the style of the bottom border
color Sets the color of the bottom border
initial Sets this property to its default value.
inherit Inherits this property from its parent element.

Technical Details

Item Value
Default Value: not specified
Return Value: A String, representing the width, style and/or color of the bottom border of an element
CSS VersionCSS1

Get a bottom border of a <div> element:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<div id="myDiv" style="border-bottom:thick solid red">This is a div element.</div>
<br>
<button type="button" onclick="myFunction()">Test</button>

<script>
function myFunction() {/*w w w. j  a v a  2s. co  m*/
    console.log(document.getElementById("myDiv").style.borderBottomWidth);
}
</script>

</body>
</html>

Related Tutorials