How to Make One Flex Item Full-Width in CSS Flexbox? Last Updated : 11 Jan, 2025 Comments Improve Suggest changes Like Article Like Report Here are the methods to make a single flex item take up the full width in CSS Flexbox:1. Using flex: 1 1 100% and orderBy setting flex: 1 1 100% on the desired item, it will occupy the full width of the container. The order property can be used to position this item within the flex container. HTML <html> <head> <style> .container { display: flex; flex-wrap: wrap; } .item { flex: 1 1 30%; margin: 10px; background-color: lightgreen; text-align: center; padding: 20px; } .full-width { flex: 1 1 100%; order: -1; } </style> </head> <body> <div class="container"> <div class="item full-width">Full Width Item</div> <div class="item">Item 1</div> <div class="item">Item 2</div> <div class="item">Item 3</div> <div class="item">Item 4</div> </div> </body> </html> The .container is a flex container with wrapping enabled.Each .item is set to occupy 30% of the container's width, allowing multiple items per row.The .full-width class sets flex: 1 1 100%, making this item span the entire width of the container. The order: -1 property moves this item to the beginning of the flex container.2. Using flex-basis: 100%Setting flex-basis: 100% on the desired item ensures it takes up the full width of the container. HTML <html> <head> <style> .container { display: flex; flex-wrap: wrap; } .item { flex: 1 1 30%; margin: 10px; background-color: lightblue; text-align: center; padding: 20px; } .full-width { flex-basis: 100%; } </style> </head> <body> <div class="container"> <div class="item">Item 1</div> <div class="item">Item 2</div> <div class="item full-width">Full Width Item</div> <div class="item">Item 3</div> <div class="item">Item 4</div> </div> </body> </html> The .container is a flex container with wrapping enabled.Each .item is set to occupy 30% of the container's width.The .full-width class sets flex-basis: 100%, causing this item to span the full width of the container. Comment More infoAdvertise with us Next Article How to Make One Flex Item Full-Width in CSS Flexbox? G gauravggeeksforgeeks Follow Improve Article Tags : Web Technologies CSS CSS-Questions Similar Reads How to Make Flex Items Overlap with CSS Flexbox? In CSS FlexBox, items can be arranged in any layout with great flexibility and control. One interesting effect that can be done is overlapping flex items. This can be done using different techniques such as negative margins and absolute positioning, allowing for creative and visually appealing desig 3 min read How to Make Flexbox Items of Same Size Using CSS? To make Flexbox items the same size using CSS, you can use various properties to control the dimensions of the items and ensure consistency in layout. By default, Flexbox items can have different sizes based on their content, but with a few CSS changes, you can make them uniform.1. Using Flex Proper 5 min read How to Create a Responsive Image Gallery with Flexbox? A responsive image gallery adjusts to different screen sizes to ensure that images look good on all devices. Flexbox, a CSS layout model, provides a powerful way to create a responsive image gallery by allowing flexible and efficient arrangements of items within a container. ApproachCreate a contain 3 min read How to Create a Masonry grid with flexbox in CSS? Masonry Grid in CSS is a layout technique that arranges items in a way that resembles a masonry wall, where items of varying heights are placed in columns, filling in gaps and creating a staggered appearance. This can be done using Flexbox by allowing items to wrap and adjusting their heights to cre 3 min read How to move Flex Items to the Right in Tailwind CSS ? Aligning flex items to the right within a flex container refers to positioning the child elements (flex items) towards the right-hand side of the container when using the flexbox layout in CSS. This alignment can be achieved through various techniques or Tailwind CSS utility classes. Table of Conten 3 min read Like