About 1,340,000 results
Open links in new tab
  1. html - Arrange 2 items per row using flexbox - Stack Overflow

    .item { width: 100% } .container { display: flex; flex-wrap: wrap; } .container > div { flex: 50%; /* or - flex: 0 50% - or - flex-basis: 50% - */ /*demo*/ box-shadow: 0 0 0 1px black; margin-bottom: 10px; }

  2. CSS Flexbox (Flexible Box Layout) - W3Schools

    Flexbox is a layout method for arranging items in rows or columns. Flexbox makes it easier to design a flexible responsive layout structure, without using float or positioning. The CSS Flexbox Layout should be used for one-dimensional layout, with rows OR columns. The CSS Grid Layout should be used for two-dimensional layout, with rows AND columns.

  3. How to Arrange Two Items Per Row Using Flexbox?

    Jul 29, 2024 · In this approach, we are using the width property combined with flex-wrap to arrange items in two per row. Each item has a width of calc (50% - 20px), which ensures they take up approximately half of the container's width while accounting for margins.

  4. CSS Flexbox Layout Guide - CSS-Tricks

    Apr 8, 2013 · Our comprehensive guide to CSS flexbox layout. This complete guide explains everything about flexbox, focusing on all the different possible properties for the parent element (the flex container) and the child elements (the flex items). It also includes history, demos, patterns, and a browser support chart. Get the poster!

  5. Breaking to a new row with flexbox - Tobias Ahlin

    You can break to a new flexbox row or column without setting the size of an item: add a collapsed flex item between two flex items

  6. css - How to evenly divide flex box items into two rows ... - Stack ...

    Jan 13, 2021 · Set flex-wrap: to wrap and give .flex-item a width of 20%; Use this: box-sizing: border-box; display: flex; flex-wrap: wrap; width: 20%;

  7. Ridiculously easy row and column layouts with Flexbox

    Aug 10, 2018 · Write really easy row and column layouts with Flexbox. Tagged with css, html, javascript, webdev.

  8. The CSS Flexbox Handbook – Complete Guide with Practical …

    Oct 18, 2023 · You can use flex as a shorthand for the flex-grow, flex-shrink, and flex-basis properties. For example, instead of writing the following: .flex-item { flex-grow : 2 ; flex-shrink : 0 ; flex-basis : 50px ; }

  9. CSS Flexbox Container - W3Schools

    The CSS flex-direction Property. The flex-direction property specifies the display-direction of flex items in the flex container. The flex-direction property can have one of the following values: row; column; row-reverse; column-reverse

  10. Aligning items in a flex container - CSS: Cascading Style Sheets

    Mar 13, 2025 · Flexbox provides several properties to control alignment and spacing, with align-items and justify-content being fundamental for centering elements. To center an element, we use the align-items property to align the item on the cross axis, which in this case is the block axis running vertically.

Refresh