The bottom
adjusts the vertical position of the element. The position of the element should be defined and its value must be absolute, fixed, relative, or sticky otherwise bottom
property will have no effect.
position
is set to absolute
or fixed
, the bottom
property sets the distance between the element's bottom edge and the bottom edge of its parent element block.position
is set to relative
, the bottom
property moves the element from its bottom edge above its normal position.position
is set to sticky
, the bottom
property behaves position: relative
when the element is inside the viewport, and like position: fixed
when it is outside.bottom: auto | value;
.div-2 {
padding: 10px;
background-color: yellow;
position: relative;
bottom: 10px;
}
auto: automatically sets the position from the bottom edge. (Default value)
value: sets the given length value as the position from the bottom edge.