How to align content of a div to the bottom?
How to align content of a div to the bottom?
20005-Jun-2024
Updated on 06-Jun-2024
Home / DeveloperSection / Forums / How to align content of a div to the bottom?
How to align content of a div to the bottom?
Ashutosh Kumar Verma
06-Jun-2024Align div content to the bottom
To align the content of a div to the bottom, you can use the align-items property if the parent container is a flex container.
You can also use the position property if you want to align it with n its parent. Whether it's a flex container or not.
There are two methods to achieve this,
1. Using flexbox (align-items)
HTML
CSS
2. Using Positioning
HTML
CSS
Choose the method that best fits your layout and requirements. Flexbox is generally more flexible and easier to manage for aligning items within a container, especially if the layout is dynamic.
Positioning is useful for aligning content relative to its containing element, regardless of its relationship to other elements.
Example-
Output-