How to Align Items to End Position using CSS ? Last Updated : 25 Sep, 2023 Summarize Comments Improve Suggest changes Share Like Article Like Report To align elements to the end, you can use the CSS property justify-content: flex-end; in a flexbox container, and for aligning elements to the end vertically, you can use the CSS property align-items: flex-end; in a flexbox container. This property aligns the flex items along the cross-axis (vertical axis) of the container. Here we are using these approaches with the help of basic examples: Table of ContentUsing Justify-content PropertyUsing align-item PropertyUsing Justify-content PropertyIn this approach we are using the justify-content: flex-end; CSS property aligns flex items to the end of the container, pushing them to the right side horizontally. Syntax: .container { display: flex; justify-content: flex-end;}Example: In this example, we create a flex container with three red boxes aligned to the right due to the "justify-content: flex-end" CSS property. HTML <!DOCTYPE html> <html> <head> <style> .container { display: flex; justify-content: flex-end; height: 200px; /* Just for demonstration */ border: 1px solid black; /* Just for demonstration */ } .item { width: 50px; height: 50px; background-color: red; margin: 5px; } </style> </head> <body> <div class="container"> <div class="item"></div> <div class="item"></div> <div class="item"></div> </div> </body> </html> Output: Using align-item PropertyIn this approach align-items: flex-end is used to align flex items vertically at the bottom of a container. This property can be helpful if you want to align items in a flex container to the end of the cross-axis. Syntax: .container { display: flex; align-items: flex-end;}Example: in this example, three red boxes in a flex container, are vertically aligned at the bottom due to the "align-items: flex-end" CSS property. HTML <!DOCTYPE html> <html> <head> <style> .container { display: flex; align-items: flex-end; height: 200px; border: 1px solid black; } .item { width: 50px; height: 50px; background-color: red; margin: 5px; } </style> </head> <body> <div class="container"> <div class="item"></div> <div class="item"></div> <div class="item"></div> </div> </body> </html> Output: Comment More infoAdvertise with us Next Article How to Align One Item to the Right using CSS Flexbox ? P princejai9073 Follow Improve Article Tags : Web Technologies CSS CSS-Questions Similar Reads How to Align One Item to the Right using CSS Flexbox ? Methods to Align a Single Item to the Right using CSS Flexbox:1. Using margin-left: autoApplying margin-left: auto to the specific flex item pushes it to the right, utilizing the available space.HTML<html> <head> <style> .flex-container { display: flex; background-color: #f0f0f0; p 3 min read How to Align Images Side By Side using CSS ? Images side by side means placing multiple images in a single row next to each other. This arrangement shows images in a horizontal line, making it great for photo galleries, and comparing pictures. To align images side by side using CSS, we can use flexbox or grid for layout.Table of ContentUsing t 2 min read How to align item to the flex-end in the container using CSS ? Aligning items to the flex-end in a container using CSS helps create visually appealing layouts by ensuring content is positioned at the end of the container. To align items to the flex-end within a container using CSS, apply the justify-items: flex-end; property to the container. This shifts items 3 min read How to align item set to its default value in CSS ? In this article, we will learn how to align an item set to its default value in CSS. Approach: The align-items property is used to set the alignment of items inside the flexible container or in the given window. It takes value. The initial value is used to set this property value to the default valu 2 min read How to Align Images in CSS? Aligning images properly is essential for creating visually appealing and well-structured web pages. CSS can provide several methods to achieve this, each suited for the different scenarios. we are going to discuss how can we align images using CSS.Below are the following approaches to align images 6 min read How to Align Right in a Table Cell using CSS ? Aligning right in a table cell means positioning the content of the cell to the right side. In CSS, this can be achieved by applying the text-align property to the table cell or using the td selector.Align right in a table cell Using text-align propertyTo align the contents of a table cell to right, 2 min read Like