{"id":6334,"date":"2024-04-14T19:00:19","date_gmt":"2024-04-14T11:00:19","guid":{"rendered":"https:\/\/webflow.tenten.co\/?p=6334"},"modified":"2024-04-14T19:00:19","modified_gmt":"2024-04-14T11:00:19","slug":"uniform-size-layouts-with-flexbox","status":"publish","type":"post","link":"https:\/\/webflow.tenten.co\/en\/uniform-size-layouts-with-flexbox\/","title":{"rendered":"Uniform size layouts with flexbox"},"content":{"rendered":"\n<div class=\"docs_rich-text w-richtext\">\n<p>When utilizing the <a href=\"https:\/\/help.webflow.com\/article\/columns\">columns element<\/a>, achieving equal heights for all columns can be challenging, especially when each column contains varying content. While setting a fixed pixel height is a possibility, it may lead to reflowing issues. Here we\u2019ll explore how to establish uniform size layouts using flexbox.\u00a0<\/p>\n<h5>Within this instructional session<\/h5>\n<ul>\n<li>Establishing the layout<\/li>\n<li>Adjusting\u00a0the parent to flex and aligning the children for stretching<\/li>\n<li>Determining column width<\/li>\n<li>Applying the auto margin technique<\/li>\n<\/ul>\n<h5>Prior to commencing<\/h5>\n<p>To replicate the initial arrangement seen in the video, insert a div block onto your page. Populate it with some content: a heading, a paragraph, a button. Duplicate the div block twice to obtain 3 div blocks each with content. Modify the content as needed.<\/p>\n<h2>Establishing the layout<\/h2>\n<p>For instance, assume we already have three div blocks with content on the page, each sharing identical class names and styles. We will introduce a container to the page, assign it a class, and insert these three div blocks within it.<\/p>\n<figure class=\"w-richtext-figure-type-image w-richtext-align-fullwidth\" data-rt-type=\"image\" data-rt-align=\"fullwidth\" data-rt-max-width=\"1501px\">\n<div><img decoding=\"async\" src=\"https:\/\/webflow-s3.tenten.co\/2024\/04\/64b949de147ed104a973c984_61315cf01045377d6dc1c9cd_equal-height-flexbox_1.png\" loading=\"lazy\" width=\"auto\" height=\"auto\" alt='Three divs named Pricing block are housed within a container labeled Flex container. These divs encompass text and a button each. They are vertically stacked with the second one featuring a green \"Best choice\" badge.' title=\"64b949de147ed104a973c984_61315cf01045377d6dc1c9cd_equal-height-flexbox_1\"><\/div>\n<\/figure>\n<h2>Adjusting\u00a0the parent to flex and aligning the children for stretching<\/h2>\n<p>Once the three div blocks are nested within the container, we can change the container\u2019s display setting to flex.<\/p>\n<p>The default flex settings are configured to <strong>Direction: Horizontal,<\/strong><strong>Justify: Start<\/strong>, and <strong>Align: Stretch<\/strong>, precisely meeting the requirements for uniform height.<\/p>\n<figure class=\"w-richtext-figure-type-image w-richtext-align-center\" data-rt-type=\"image\" data-rt-align=\"center\">\n<div><img decoding=\"async\" src=\"https:\/\/webflow-s3.tenten.co\/2024\/04\/64b949de147ed104a973c997_613156d25514b208bb823308_equal-height-flexbox_2.png\" loading=\"lazy\" width=\"auto\" height=\"auto\" alt=\"The layout settings are set to display flex, direction horizontal, align stretch, and justify left. The three divs are now arranged in a single row with varying widths.\" title=\"64b949de147ed104a973c997_613156d25514b208bb823308_equal-height-flexbox_2\"><\/div>\n<\/figure>\n<h2>Determining column width<\/h2>\n<p>However, note that the divs&#8217; widths are not uniform. You can achieve uniformity by setting the div blocks\u2019 width to <strong>33.33%<\/strong> (alternatively, you can perform calculations like <strong>100\/3%<\/strong>, then hit enter). Alternatively, you can designate the div blocks\u2019 flex child settings to <strong>Expand.<\/strong><\/p>\n<figure class=\"w-richtext-figure-type-image w-richtext-align-center\" data-rt-type=\"image\" data-rt-align=\"center\">\n<div><img decoding=\"async\" src=\"https:\/\/webflow-s3.tenten.co\/2024\/04\/64b949de147ed104a973c97d_6131552b3042050ed42fe024_equal-height-flexbox_3.png\" loading=\"lazy\" width=\"auto\" height=\"auto\" alt=\"Two panels displaying size settings side by side. The left panel shows the width set to 33.33%. The right panel displays the width as 100 divided by 3% in the input fields.\" title=\"64b949de147ed104a973c97d_6131552b3042050ed42fe024_equal-height-flexbox_3\"><\/div>\n<\/figure>\n<h2>Auto margin technique<\/h2>\n<p>In this scenario, we aim to align the content within the divs uniformly. This can also be achieved using flexbox configurations.<\/p>\n<ol>\n<li>Choose one of the divs<\/li>\n<li>Modify its display setting to flex<\/li>\n<li>Configure the Flex layout to Vertical<\/li>\n<li>Select the button<\/li>\n<li>Adjust its top margin to auto<\/li>\n<\/ol>\n<p>Consequently, the button\u2019s margin will automatically adapt, leading to uniform alignment of all three buttons.<\/p>\n<figure class=\"w-richtext-figure-type-image w-richtext-align-fullwidth\" data-rt-type=\"image\" data-rt-align=\"fullwidth\" data-rt-max-width=\"1501px\">\n<div><img decoding=\"async\" src=\"https:\/\/webflow-s3.tenten.co\/2024\/04\/64b949de147ed104a973c980_613156e0baf2487ecdba5308_equal-height-flexbox_4.png\" loading=\"lazy\" width=\"auto\" height=\"auto\" alt='On the left, the button with the text \"get in touch now\" is selected. On the right, the popup window for the top margin displays the Auto setting in action. This setting is highlighted.' title=\"64b949de147ed104a973c980_613156e0baf2487ecdba5308_equal-height-flexbox_4\"><\/div>\n<\/figure>\n<\/div>\n","protected":false},"excerpt":{"rendered":"Use flexbox to set equal heights for columns \u2014 even when each column has different content inside.","protected":false},"author":2,"featured_media":6335,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"om_disable_all_campaigns":false,"inline_featured_image":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"csco_display_header_overlay":false,"csco_singular_sidebar":"","csco_page_header_type":"","footnotes":""},"categories":[284],"tags":[],"class_list":{"0":"post-6334","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-layout-design","8":"cs-entry"},"acf":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/webflow.tenten.co\/en\/wp-json\/wp\/v2\/posts\/6334","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webflow.tenten.co\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webflow.tenten.co\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webflow.tenten.co\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/webflow.tenten.co\/en\/wp-json\/wp\/v2\/comments?post=6334"}],"version-history":[{"count":0,"href":"https:\/\/webflow.tenten.co\/en\/wp-json\/wp\/v2\/posts\/6334\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webflow.tenten.co\/en\/wp-json\/wp\/v2\/media\/6335"}],"wp:attachment":[{"href":"https:\/\/webflow.tenten.co\/en\/wp-json\/wp\/v2\/media?parent=6334"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webflow.tenten.co\/en\/wp-json\/wp\/v2\/categories?post=6334"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webflow.tenten.co\/en\/wp-json\/wp\/v2\/tags?post=6334"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}