CSS bottom Property
The bottom property controls the vertical position or bottom inset of a positioned element relative to its containing block.
Its behavior depends on the element's position value. It can offset a relatively positioned element, position an absolutely or fixed positioned element, or establish a threshold for sticky positioning.
The property accepts CSS lengths, percentages, auto, and supported CSS anchor positioning functions. It does not affect elements using the default position: static.
bottom Syntax
Set the bottom property to a length, percentage, auto, or supported anchor positioning value.
selector {
position: absolute;
bottom: 20px;
}
The general syntax is:
selector {
bottom: auto | <length-percentage> | <anchor()> | <anchor-size()>;
}
The anchor functions are available where CSS anchor positioning is supported.
Pixel Value
.element {
position: absolute;
bottom: 20px;
}
Percentage Value
.element {
position: absolute;
bottom: 10%;
}
Relative Length
.element {
position: absolute;
bottom: 2rem;
}
Negative Value
.element {
position: absolute;
bottom: -15px;
}
Calculated Value
.element {
position: absolute;
bottom: calc(1rem + 10px);
}
Automatic Position
.element {
position: absolute;
bottom: auto;
}
Anchor Position
.element {
position: absolute;
bottom: anchor(top);
}
CSS-Wide Keywords
.inherited {
bottom: inherit;
}
.reset {
bottom: initial;
}
.unset {
bottom: unset;
}
.reverted {
bottom: revert;
}
.layer-reverted {
bottom: revert-layer;
}
The bottom property accepts a single value. Its positioning effect depends on the element's positioning scheme.
Property Values
The bottom property accepts the following values:
| Value | Description |
|---|---|
auto |
Allows the positioning scheme and other constraints to determine the bottom inset. This is the initial value. |
<length> |
Specifies a bottom inset or relative offset using a CSS length such as px, rem, or em. |
<percentage> |
Specifies a value relative to the height of the containing block. |
calc() |
Combines compatible lengths and percentages in a calculated value. |
anchor() |
Positions an eligible element relative to an anchor edge where CSS anchor positioning is supported. |
anchor-size() |
Uses a dimension of an anchor element as part of the inset value where supported. |
CSS-Wide Keywords
| Value | Description |
|---|---|
inherit |
Inherits the computed bottom value from the parent. |
initial |
Resets the property to auto. |
unset |
Resets the property to auto because it is not inherited. |
revert |
Reverts the property according to cascade origin rules. |
revert-layer |
Reverts the property according to cascade layer rules. |
Property Characteristics
| Characteristic | Value |
|---|---|
| Initial value | auto |
| Inherited | No |
| Applies to | Positioned elements |
| Computed value | Specified length, percentage, or auto, with supported calculations resolved as appropriate |
| Animation type | Length, percentage, or calculated value |
| Percentages | Relative to the containing block's height |
| Negative values | Allowed |
| Physical side | Bottom |
The bottom property does not inherit automatically and has no positioning effect on statically positioned elements.
How It Works
The effect of bottom depends on the element's position value.
| Position | Behavior |
|---|---|
static |
The bottom property has no positioning effect. |
relative |
A positive value moves the element upward from its normal position. |
absolute |
Positions the element relative to its containing block's bottom edge. |
fixed |
Positions the element relative to its fixed-position containing block, commonly the viewport. |
sticky |
Establishes a bottom inset constraint during scrolling. |
Step 1: Create a Container
<div class="container">
<div class="badge">Bottom Badge</div>
</div>
Step 2: Establish a Containing Block
.container {
position: relative;
height: 200px;
background-color: #e7f3fc;
}
Step 3: Position the Child
.badge {
position: absolute;
bottom: 20px;
right: 20px;
}
The badge is positioned 20 pixels from the container's bottom padding edge and 20 pixels from its right padding edge.
Step 4: Change the Bottom Inset
.badge {
bottom: 40px;
}
The badge moves upward, increasing the distance from the bottom edge.
Step 5: Use a Negative Value
.badge {
bottom: -10px;
}
The badge extends below the containing block's bottom edge.
For absolutely positioned elements, the bottom inset is measured from the containing block to the element's margin edge.
Static Positioning
Elements use position: static by default. The bottom property does not change their position.
.element {
position: static;
bottom: 20px;
}
The element remains in its normal document flow position.
Making bottom Effective
.element {
position: relative;
bottom: 20px;
}
Changing the positioning scheme to relative allows the bottom offset to affect the element.
Use margin, padding, Flexbox, or Grid for ordinary layout spacing rather than positioning static elements with bottom.
Relative Positioning
With position: relative, the bottom property offsets an element from its normal position without removing it from document flow.
Positive Bottom Value
.element {
position: relative;
bottom: 20px;
}
The element moves upward by 20 pixels.
Negative Bottom Value
.element {
position: relative;
bottom: -20px;
}
The element moves downward by 20 pixels.
Zero Bottom Value
.element {
position: relative;
bottom: 0;
}
The element has no vertical offset from its normal position.
Relative Offset Example
<p>First paragraph.</p>
<p class="raised">Raised paragraph.</p>
<p>Third paragraph.</p>
.raised {
position: relative;
bottom: 12px;
background-color: #e7f3fc;
}
The middle paragraph moves upward visually, but the surrounding paragraphs retain their normal layout positions.
Relative Positioning and top
.element {
position: relative;
top: 10px;
bottom: 20px;
}
When both vertical offsets are specified for a relatively positioned element, top takes precedence. The bottom value does not produce an additional offset.
Relative positioning is useful for small visual adjustments, but it does not close the space originally occupied by the element.
Absolute Positioning
With position: absolute, the element is removed from normal document flow and positioned relative to its containing block.
Bottom of a Container
<div class="card">
<span class="label">New</span>
</div>
.card {
position: relative;
height: 200px;
background-color: #e7f3fc;
}
.label {
position: absolute;
bottom: 12px;
right: 12px;
padding: 6px 12px;
background-color: #1769aa;
color: #ffffff;
}
The label appears near the bottom-right corner of the card.
Bottom-Left Position
.label {
position: absolute;
bottom: 12px;
left: 12px;
}
Centered Along the Bottom
.label {
position: absolute;
bottom: 12px;
left: 50%;
transform: translateX(-50%);
}
Flush with the Bottom Edge
.label {
position: absolute;
bottom: 0;
left: 0;
}
Outside the Bottom Edge
.label {
position: absolute;
bottom: -12px;
right: 12px;
}
The label extends below the containing block.
Full-Width Bottom Bar
.bottom-bar {
position: absolute;
bottom: 0;
left: 0;
right: 0;
padding: 12px;
background-color: #1769aa;
color: #ffffff;
}
The bar stretches across the available width of its containing block when its width and horizontal margins are automatic.
For predictable absolute positioning, establish the intended containing block using position: relative on an appropriate ancestor.
Fixed Positioning
With position: fixed, the element is removed from normal document flow and positioned relative to its fixed-position containing block, usually the viewport.
Fixed Bottom Button
.back-to-top {
position: fixed;
bottom: 24px;
right: 24px;
padding: 12px 16px;
background-color: #1769aa;
color: #ffffff;
}
The button normally remains 24 pixels from the viewport's bottom edge while the page scrolls.
Fixed Bottom Bar
.bottom-bar {
position: fixed;
bottom: 0;
left: 0;
right: 0;
padding: 16px;
background-color: #173b5e;
color: #ffffff;
}
Fixed Bottom-Left Notice
.notice {
position: fixed;
bottom: 20px;
left: 20px;
max-width: 300px;
}
Safe Area Spacing
.floating-button {
position: fixed;
bottom: calc(16px + env(safe-area-inset-bottom));
right: 16px;
}
The safe-area inset helps prevent the button from overlapping device interface areas on supported devices.
Fixed Positioning Caveat
Some ancestor properties, including certain transforms and containment settings, can establish a fixed-position containing block. In those cases, the element may be positioned relative to that ancestor rather than the viewport.
Fixed elements can cover page content. Provide sufficient spacing and avoid obscuring important controls.
Sticky Positioning
With position: sticky, the bottom property establishes a bottom inset constraint relative to the nearest relevant scrollport.
Sticky positioning combines normal flow positioning with scroll-dependent offsets. A sticky element remains constrained by its containing block.
Sticky Bottom Element
.sticky-footer {
position: sticky;
bottom: 0;
padding: 16px;
background-color: #e7f3fc;
}
The element can be shifted to remain within the bottom inset constraint during scrolling, depending on its normal position, container size, and scroll range.
Sticky Bottom Offset
.sticky-footer {
position: sticky;
bottom: 20px;
}
Sticky Element in a Scroll Container
<div class="scroll-panel">
<div class="content">
<p>Scrollable content...</p>
</div>
<div class="sticky-actions">
<button type="button">Continue</button>
</div>
</div>
.scroll-panel {
height: 240px;
overflow-y: auto;
}
.content {
min-height: 500px;
}
.sticky-actions {
position: sticky;
bottom: 0;
padding: 12px;
background-color: #ffffff;
}
The action area participates in normal flow but can remain constrained to the bottom of the scrollport as the content scrolls.
Sticky vs. Fixed
A fixed element is removed from normal flow. A sticky element remains in normal flow and is limited by its containing block and scrolling conditions.
Sticky positioning does not automatically pin every element to the bottom of the viewport. Its behavior depends on the available scrolling space and the element's normal position.
Length Values
The bottom property accepts positive, zero, and negative CSS lengths.
Pixels
.element {
position: absolute;
bottom: 20px;
}
rem Units
.element {
position: absolute;
bottom: 1.5rem;
}
The offset is based on the root element's font size.
em Units
.element {
position: absolute;
bottom: 2em;
}
The offset is based on the element's font size.
Viewport Units
.element {
position: fixed;
bottom: 5vh;
}
The offset is based on the viewport height.
Calculated Length
.element {
position: absolute;
bottom: calc(1rem + 10px);
}
Clamped Length
.element {
position: fixed;
bottom: clamp(12px, 3vh, 40px);
}
The clamp() function provides a responsive offset with minimum and maximum limits.
Unitless Zero
.element {
position: absolute;
bottom: 0;
}
Zero does not require a unit.
Use pixels or rem units for consistent interface spacing, and responsive calculations when the offset should adapt to available space.
Percentage Values
Percentage values for bottom are calculated relative to the height of the containing block.
Ten Percent from the Bottom
.container {
position: relative;
height: 300px;
}
.element {
position: absolute;
bottom: 10%;
}
The bottom inset is 30 pixels when the containing block is 300 pixels tall.
Fifty Percent
.element {
position: absolute;
bottom: 50%;
}
The element's bottom margin edge is positioned at an inset equal to half the containing block's height.
Percentage with a Calculation
.element {
position: absolute;
bottom: calc(10% + 12px);
}
Negative Percentage
.element {
position: absolute;
bottom: -10%;
}
A negative percentage can place the element below the containing block's bottom edge.
Percentage with Relative Positioning
.element {
position: relative;
bottom: 10%;
}
The offset is based on the containing block's height. If that height depends on its content and is not definite, the percentage may not produce the expected displacement.
Percentage offsets are useful when the position should scale with the containing block rather than remain a fixed distance.
Negative Values
Negative values are valid and can move positioned elements below their normal or containing block positions.
Negative Absolute Offset
.badge {
position: absolute;
bottom: -12px;
}
The badge extends 12 pixels below the containing block's bottom edge, assuming zero margins.
Negative Relative Offset
.element {
position: relative;
bottom: -20px;
}
The element moves downward by 20 pixels.
Overlapping Badge
.card {
position: relative;
}
.card-badge {
position: absolute;
bottom: -10px;
right: 16px;
}
Negative Calculated Offset
.element {
position: absolute;
bottom: calc(-1rem - 4px);
}
Negative offsets can create intentional overlap, but content may be clipped by ancestor overflow settings or extend outside the viewport.
Using top and bottom Together
The top and bottom properties can work together to control an element's vertical position and size.
Stretching an Absolute Element
.container {
position: relative;
height: 300px;
}
.overlay {
position: absolute;
top: 20px;
bottom: 20px;
left: 20px;
right: 20px;
}
With an automatic height and compatible sizing constraints, the overlay stretches vertically between the top and bottom insets.
Full-Height Overlay
.overlay {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
}
Fixed Height with Both Insets
.element {
position: absolute;
top: 20px;
bottom: 20px;
height: 100px;
}
If the vertical constraints are over-constrained, the browser resolves the conflict according to the positioning rules. For a non-replaced absolutely positioned element with a definite height and both margins specified as zero, the bottom inset may be effectively overridden.
Relative Positioning Conflict
.element {
position: relative;
top: 10px;
bottom: 20px;
}
For relative positioning, top takes precedence when both vertical offsets are specified.
Sticky Positioning with Both Insets
.element {
position: sticky;
top: 10px;
bottom: 10px;
}
The insets establish constraints on the sticky view rectangle. The actual movement depends on scrolling, the element's size, and its containing block.
Use both vertical insets when an element needs to occupy a defined vertical region, rather than simply move from one edge.
The inset Shorthand
The inset shorthand sets the top, right, bottom, and left properties in one declaration.
One Value
.element {
position: absolute;
inset: 20px;
}
All four insets are 20 pixels.
Two Values
.element {
position: absolute;
inset: 10px 20px;
}
The top and bottom insets are 10 pixels. The right and left insets are 20 pixels.
Three Values
.element {
position: absolute;
inset: 10px 20px 30px;
}
The top inset is 10 pixels, the right and left insets are 20 pixels, and the bottom inset is 30 pixels.
Four Values
.element {
position: absolute;
inset: 10px 20px 30px 40px;
}
The values apply clockwise: top, right, bottom, and left.
Overriding bottom
.element {
position: absolute;
inset: 20px;
bottom: 40px;
}
The later bottom declaration overrides only the bottom inset.
Shorthand Override
.element {
position: absolute;
bottom: 40px;
inset: 20px;
}
The later shorthand resets the bottom inset to 20 pixels.
Use inset for multiple edges and bottom when only the bottom inset needs to change.
Physical vs. Logical Positioning
The bottom property always targets the physical bottom edge. Logical inset properties follow writing mode and text direction.
Physical Bottom Inset
.element {
position: absolute;
bottom: 20px;
}
Logical Block-End Inset
.element {
position: absolute;
inset-block-end: 20px;
}
Horizontal Writing Mode
.container {
writing-mode: horizontal-tb;
}
.element {
position: absolute;
inset-block-end: 20px;
}
In horizontal top-to-bottom writing mode, block-end corresponds to the physical bottom edge.
Vertical Right-to-Left Writing Mode
.container {
writing-mode: vertical-rl;
}
.element {
position: absolute;
inset-block-end: 20px;
}
In vertical right-to-left writing mode, block-end corresponds to the physical left edge.
Vertical Left-to-Right Writing Mode
.container {
writing-mode: vertical-lr;
}
.element {
position: absolute;
inset-block-end: 20px;
}
In vertical left-to-right writing mode, block-end corresponds to the physical right edge.
Logical Inset Shorthand
.element {
position: absolute;
inset-block: 10px 20px;
}
The first value applies to block-start, and the second applies to block-end.
Use bottom for a fixed physical edge and inset-block-end when positioning should adapt to writing mode.
Containing Block
The containing block determines the reference area used to resolve the bottom inset.
Positioned Ancestor
<div class="outer">
<div class="inner">
<div class="badge">Badge</div>
</div>
</div>
.outer {
position: relative;
height: 300px;
}
.inner {
height: 150px;
}
.badge {
position: absolute;
bottom: 20px;
}
The badge uses the outer element as its containing block because the inner element is not positioned and does not otherwise establish an absolute-position containing block.
Changing the Containing Block
.inner {
position: relative;
height: 150px;
}
The badge now uses the inner element as its containing block.
Containing Block Padding Edge
.container {
position: relative;
padding: 20px;
}
.badge {
position: absolute;
bottom: 0;
}
For a typical positioned block ancestor, the containing block is formed by its padding box. A zero bottom inset places the badge's bottom margin edge at the containing block's bottom edge.
Fixed Position Containing Block
.fixed-element {
position: fixed;
bottom: 20px;
}
The viewport is commonly the containing block, although certain ancestor properties can establish a different one.
Transforms and Containing Blocks
.container {
transform: translateZ(0);
}
.fixed-element {
position: fixed;
bottom: 20px;
}
A transformed ancestor can establish the containing block for a fixed-position descendant, changing how its bottom inset is resolved.
When an element appears positioned relative to the wrong area, inspect its ancestors for positioning, transforms, containment, and related properties.
CSS Anchor Positioning
CSS anchor positioning allows eligible positioned elements to align with another element's edges or dimensions.
The bottom property can use the anchor() and anchor-size() functions where supported.
Define an Anchor
.anchor-button {
anchor-name: --menu-anchor;
}
Position an Element Above the Anchor
.popup {
position: absolute;
position-anchor: --menu-anchor;
bottom: anchor(top);
left: anchor(left);
}
The popup's bottom edge is aligned with the anchor's top edge when the anchor and positioned element satisfy the required anchor positioning relationships.
Add Spacing Above the Anchor
.popup {
position: absolute;
position-anchor: --menu-anchor;
bottom: calc(anchor(top) + 8px);
left: anchor(left);
}
The popup is positioned with an additional 8-pixel gap above the anchor.
Using anchor-size()
.popup {
position: absolute;
position-anchor: --menu-anchor;
bottom: anchor-size(height);
}
The inset uses the anchor element's height. This differs from aligning directly to an anchor edge.
Fallback Positioning
.popup {
position: absolute;
bottom: 100%;
}
@supports (bottom: anchor(top)) {
.popup {
position-anchor: --menu-anchor;
bottom: anchor(top);
}
}
CSS anchor positioning has more limited browser availability than traditional bottom positioning. Test support before relying on it for essential interface behavior.
Layout and Overflow
Positioned elements can overlap other content or extend outside their containing blocks.
Absolute Elements and Normal Flow
.badge {
position: absolute;
bottom: 0;
}
An absolutely positioned element does not reserve space in normal document flow.
Relative Elements and Normal Flow
.badge {
position: relative;
bottom: 20px;
}
The element moves visually but retains its original space in the layout.
Clipping Overflow
.container {
position: relative;
overflow: hidden;
}
.badge {
position: absolute;
bottom: -20px;
}
The badge may be clipped where it extends outside the container's clipping area.
Allowing Overflow
.container {
position: relative;
overflow: visible;
}
.badge {
position: absolute;
bottom: -20px;
}
The badge can extend beyond the container, subject to clipping by other ancestors or the viewport.
Stacking Order
.badge {
position: absolute;
bottom: 10px;
z-index: 10;
}
The z-index property can influence the stacking order of positioned elements.
Avoiding Covered Content
.page-content {
padding-bottom: 90px;
}
.fixed-bar {
position: fixed;
bottom: 0;
left: 0;
right: 0;
min-height: 70px;
}
Additional bottom padding can help prevent a fixed bar from covering page content. The required spacing depends on the bar's actual size.
Check overflow, stacking, and available space whenever positioned elements overlap surrounding content.
Transitions and Animation
The bottom property can animate between compatible numeric values.
Hover Transition
.badge {
position: absolute;
bottom: 10px;
transition: bottom 0.3s ease;
}
.card:hover .badge {
bottom: 25px;
}
Keyframe Animation
@keyframes move-up {
from {
bottom: 0;
}
to {
bottom: 40px;
}
}
.badge {
position: absolute;
animation: move-up 1s ease-in-out alternate infinite;
}
Transition Between Percentages
.badge {
position: absolute;
bottom: 10%;
transition: bottom 0.4s ease;
}
.card:hover .badge {
bottom: 30%;
}
Using transform Instead
.badge {
position: absolute;
bottom: 10px;
transition: transform 0.3s ease;
}
.card:hover .badge {
transform: translateY(-15px);
}
Transforms are often preferable for purely visual movement because they generally avoid layout recalculation.
Reduced Motion Preference
.badge {
position: absolute;
bottom: 10px;
transition: transform 0.3s ease;
}
.card:hover .badge {
transform: translateY(-15px);
}
@media (prefers-reduced-motion: reduce) {
.badge {
transition: none;
}
}
Transitions involving auto may not interpolate as expected. Use explicit compatible lengths or percentages when smooth animation is required.
Responsive Design
The bottom property can adapt to viewport size, container dimensions, and device safe areas.
Media Query
.floating-button {
position: fixed;
bottom: 30px;
right: 30px;
}
@media (max-width: 600px) {
.floating-button {
bottom: 15px;
right: 15px;
}
}
Responsive Calculation
.floating-button {
position: fixed;
bottom: clamp(12px, 3vh, 40px);
}
Container Query
.card-container {
container-type: inline-size;
}
.card {
position: relative;
}
.card-badge {
position: absolute;
bottom: 10px;
}
@container (min-width: 500px) {
.card-badge {
bottom: 25px;
}
}
Safe Area Insets
.fixed-bar {
position: fixed;
bottom: 0;
left: 0;
right: 0;
padding-bottom: calc(12px + env(safe-area-inset-bottom));
}
Changing Positioning on Small Screens
.action-panel {
position: absolute;
bottom: 20px;
}
@media (max-width: 600px) {
.action-panel {
position: static;
bottom: auto;
}
}
On smaller screens, returning an element to normal flow can prevent overlap and improve readability.
Responsive positioning should account for content height, viewport dimensions, and interactive controls.
Practical Uses
The bottom property is useful for badges, overlays, floating buttons, captions, and anchored interface elements.
Image Caption
.image-wrapper {
position: relative;
}
.image-caption {
position: absolute;
bottom: 0;
left: 0;
right: 0;
padding: 12px;
background-color: rgb(0 0 0 / 70%);
color: #ffffff;
}
Card Badge
.card {
position: relative;
}
.card-badge {
position: absolute;
bottom: 12px;
right: 12px;
}
Bottom Navigation Bar
.mobile-nav {
position: fixed;
bottom: 0;
left: 0;
right: 0;
background-color: #173b5e;
color: #ffffff;
}
Back-to-Top Button
.back-to-top {
position: fixed;
bottom: 24px;
right: 24px;
}
Bottom-Centered Label
.label {
position: absolute;
bottom: 12px;
left: 50%;
transform: translateX(-50%);
}
Overlapping Badge
.badge {
position: absolute;
bottom: -10px;
right: 20px;
}
Full Container Overlay
.overlay {
position: absolute;
inset: 0;
background-color: rgb(0 0 0 / 40%);
}
Sticky Action Area
.sticky-actions {
position: sticky;
bottom: 0;
padding: 16px;
background-color: #ffffff;
}
Choose the positioning scheme according to whether the element should remain in normal flow, follow a container, or stay visible during scrolling.
bottom Example
The following example demonstrates positive, zero, and negative bottom offsets inside positioned containers.
<div class="bottom-demo">
<div class="demo-container">
<span class="demo-label positive">bottom: 20px</span>
</div>
<div class="demo-container">
<span class="demo-label zero">bottom: 0</span>
</div>
<div class="demo-container">
<span class="demo-label negative">bottom: -10px</span>
</div>
</div>
.bottom-demo {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
gap: 30px;
padding: 15px 0 20px;
}
.bottom-demo .demo-container {
position: relative;
height: 160px;
border: 2px solid #1769aa;
background-color: #e7f3fc;
}
.bottom-demo .demo-label {
position: absolute;
right: 10px;
padding: 8px 12px;
background-color: #1769aa;
color: #ffffff;
font-size: 14px;
}
.bottom-demo .positive {
bottom: 20px;
}
.bottom-demo .zero {
bottom: 0;
}
.bottom-demo .negative {
bottom: -10px;
}
The first label sits 20 pixels above the container's bottom edge. The second sits flush with the bottom edge, and the third extends 10 pixels below it.
All three labels use position: absolute, with their containers establishing the containing blocks.
Important Considerations
Keep the following points in mind when using bottom:
- Purpose: Controls the bottom inset or vertical offset of positioned elements.
- Initial value:
auto. - Inheritance: The property is not inherited.
- Static positioning: The property has no positioning effect on elements using
position: static. - Relative positioning: Positive values move an element upward, and negative values move it downward.
- Absolute positioning: The bottom inset is resolved relative to the containing block.
- Fixed positioning: The containing block is commonly the viewport, but certain ancestors can change it.
- Sticky positioning: The property establishes a bottom inset constraint during scrolling.
- Percentages: Relative to the containing block's height.
- Negative values: Allowed.
- Unitless zero: Valid.
- Containing block: Determines the reference area for positioning.
- top interaction: The relationship between
topandbottomdepends on the positioning scheme and sizing constraints. - Shorthand: The
insetproperty can set all four physical insets. - Logical alternative: Use
inset-block-endwhen positioning should follow writing mode. - Anchor positioning: The
anchor()andanchor-size()functions require compatible browser support. - Normal flow: Absolute and fixed positioning remove elements from normal flow, while relative and sticky positioning retain their flow space.
- Overflow: Positioned elements can extend outside containers and may be clipped.
- Animation: Compatible numeric values can interpolate, but animating inset properties may require layout recalculation.
- Browser support: Traditional
bottompositioning is widely supported.
Use bottom when an element needs a specific vertical offset or must align with the bottom edge of its containing block.
Browser Support
The bottom property is widely available and supported in Chrome, Edge, Firefox, Safari, and other major browsers.
Traditional positioning with lengths, percentages, and auto is supported without vendor prefixes.
.container {
position: relative;
}
.element {
position: absolute;
bottom: 20px;
right: 20px;
}
This example positions an element 20 pixels from the bottom and right edges of its containing block.
CSS anchor positioning functions have more limited availability. Check support separately before using them in production layouts.
For current compatibility details, visit Can I Use? and search for bottom.
Specifications
The bottom property is defined in the CSS Positioned Layout Module Level 3 specification.
CSS Positioned Layout Module Level 3
CSS anchor positioning extends the available inset values through the CSS Anchor Positioning specification.
CSS Anchor Positioning Module Level 1
These specifications define positioning behavior, containing blocks, inset values, and interactions with other positioning properties.
