Javascript examples for CSS Style Property:bottom
The bottom property sets or gets the bottom position of an element.
Value | Description |
---|---|
length | a length value in px, pt, cm, em, etc. Negative length values are allowed. |
percentage | The percentage is calculated with respect to the height of the element's containing block. Negative percentage values are allowed. |
auto | The browser calculates the bottom edge position. Default value. |
initial | Sets this property to its default value. |
inherit | take the value of its parent element bottom property. |
Item | Value |
---|---|
Default Value: | auto |
Return Value: | A String, representing the bottom position of a positioned element |
CSS Version | CSS2 |
Get the bottom position of a <button> element:
<!DOCTYPE html> <html> <body> <div id="myDiv" style="position:absolute;bottom:0px;">This is a div element.</div> <button type="button" onclick="myFunction()">Return bottom position of div</button> <script> function myFunction() {//from w w w .jav a 2s . com console.log(document.getElementById("myDiv").style.bottom); } </script> </body> </html>