bottom
property defines the
offset between the bottom edge of a positioned
element and the bottom of its containing block.
Item | Value |
---|---|
Initial value | auto |
Inherited | No. |
Version | CSS2 |
JavaScript syntax | object.style.bottom="50px" |
Applies to | Positioned elements (position other than static). |
bottom: length | percentage | auto | inherit
The property values are listed in the following table.
Value | Description |
---|---|
auto | browser does the calculation. Default value |
length | Sets bottom in px, cm, etc. Negative values are allowed |
% | Sets bottom position in % of containing element. Negative values are allowed |
inherit | Inherit the bottom property from the parent element |
bottom |
Yes | Yes | Yes | Yes | Yes |
An example showing how to use bottom CSS property.
<!DOCTYPE HTML>
<html>
<head>
<style type="text/css">
div,p {<!--from w ww .j a va 2s . co m-->
margin: 10px;
padding: 10px;
border: 1px solid gray;
}
.pos {
position: relative;
bottom: -20px;
}
</style>
</head>
<body>
<div>
<p class="pos">Positioned</p>
</div>
</body>
</html>