Is it possible to make all the children of a `flex-flow: column` flexbox the same height as the tallest child?










2














If I have a flexbox that is styled with flex-flow: column, and that container has five child div with variable heights, is it possible to make all the children be the same height as the tallest?



I'm not necessarily looking to fill the container with them (i.e. have them fill any excess space), just all be the same height.



In the snippet below, the five child div all have different content, which causes them to be different heights; is it possible to make all five be as tall as the uppermost div, which has the most content?






html 
font-family: Arial, sans-serif;


*,
*:before,
*:after
box-sizing: border-box;
border: none;
margin: 0;
padding: 0;


body
background: #333;
color: #333;


.container
background: firebrick;
display: flex;
flex-flow: column;
height: 50rem;
margin: 0 auto;
padding: 1rem;
width: 30rem;


.panel
background: white;
padding: 1rem;


.panel:nth-child(even)
background: lightgrey;

<div class="container">
<div class="panel">Lorem ipsum dolor sit amet consectetur adipisicing elit. Magnam pariatur commodi ipsum ex quam eius voluptatibus fugit vero, consectetur explicabo cum magni fugiat natus.</div>
<div class="panel">Lorem, ipsum dolor sit amet consectetur adipisicing elit.</div>
<div class="panel">this is a test</div>
<div class="panel">Lorem ipsum dolor sit amet consectetur adipisicing elit. Nulla, commodi a!</div>
<div class="panel">Lorem ipsum dolor sit amet consectetur, adipisicing elit. Saepe, nihil pariatur enim, porro temporibus harum, quo omnis beatae eaque soluta totam ipsa?</div>
</div>












share|improve this question





















  • refer to this, its' very clear css-tricks.com/snippets/css/a-guide-to-flexbox
    – DaFois
    Nov 9 at 17:45















2














If I have a flexbox that is styled with flex-flow: column, and that container has five child div with variable heights, is it possible to make all the children be the same height as the tallest?



I'm not necessarily looking to fill the container with them (i.e. have them fill any excess space), just all be the same height.



In the snippet below, the five child div all have different content, which causes them to be different heights; is it possible to make all five be as tall as the uppermost div, which has the most content?






html 
font-family: Arial, sans-serif;


*,
*:before,
*:after
box-sizing: border-box;
border: none;
margin: 0;
padding: 0;


body
background: #333;
color: #333;


.container
background: firebrick;
display: flex;
flex-flow: column;
height: 50rem;
margin: 0 auto;
padding: 1rem;
width: 30rem;


.panel
background: white;
padding: 1rem;


.panel:nth-child(even)
background: lightgrey;

<div class="container">
<div class="panel">Lorem ipsum dolor sit amet consectetur adipisicing elit. Magnam pariatur commodi ipsum ex quam eius voluptatibus fugit vero, consectetur explicabo cum magni fugiat natus.</div>
<div class="panel">Lorem, ipsum dolor sit amet consectetur adipisicing elit.</div>
<div class="panel">this is a test</div>
<div class="panel">Lorem ipsum dolor sit amet consectetur adipisicing elit. Nulla, commodi a!</div>
<div class="panel">Lorem ipsum dolor sit amet consectetur, adipisicing elit. Saepe, nihil pariatur enim, porro temporibus harum, quo omnis beatae eaque soluta totam ipsa?</div>
</div>












share|improve this question





















  • refer to this, its' very clear css-tricks.com/snippets/css/a-guide-to-flexbox
    – DaFois
    Nov 9 at 17:45













2












2








2







If I have a flexbox that is styled with flex-flow: column, and that container has five child div with variable heights, is it possible to make all the children be the same height as the tallest?



I'm not necessarily looking to fill the container with them (i.e. have them fill any excess space), just all be the same height.



In the snippet below, the five child div all have different content, which causes them to be different heights; is it possible to make all five be as tall as the uppermost div, which has the most content?






html 
font-family: Arial, sans-serif;


*,
*:before,
*:after
box-sizing: border-box;
border: none;
margin: 0;
padding: 0;


body
background: #333;
color: #333;


.container
background: firebrick;
display: flex;
flex-flow: column;
height: 50rem;
margin: 0 auto;
padding: 1rem;
width: 30rem;


.panel
background: white;
padding: 1rem;


.panel:nth-child(even)
background: lightgrey;

<div class="container">
<div class="panel">Lorem ipsum dolor sit amet consectetur adipisicing elit. Magnam pariatur commodi ipsum ex quam eius voluptatibus fugit vero, consectetur explicabo cum magni fugiat natus.</div>
<div class="panel">Lorem, ipsum dolor sit amet consectetur adipisicing elit.</div>
<div class="panel">this is a test</div>
<div class="panel">Lorem ipsum dolor sit amet consectetur adipisicing elit. Nulla, commodi a!</div>
<div class="panel">Lorem ipsum dolor sit amet consectetur, adipisicing elit. Saepe, nihil pariatur enim, porro temporibus harum, quo omnis beatae eaque soluta totam ipsa?</div>
</div>












share|improve this question













If I have a flexbox that is styled with flex-flow: column, and that container has five child div with variable heights, is it possible to make all the children be the same height as the tallest?



I'm not necessarily looking to fill the container with them (i.e. have them fill any excess space), just all be the same height.



In the snippet below, the five child div all have different content, which causes them to be different heights; is it possible to make all five be as tall as the uppermost div, which has the most content?






html 
font-family: Arial, sans-serif;


*,
*:before,
*:after
box-sizing: border-box;
border: none;
margin: 0;
padding: 0;


body
background: #333;
color: #333;


.container
background: firebrick;
display: flex;
flex-flow: column;
height: 50rem;
margin: 0 auto;
padding: 1rem;
width: 30rem;


.panel
background: white;
padding: 1rem;


.panel:nth-child(even)
background: lightgrey;

<div class="container">
<div class="panel">Lorem ipsum dolor sit amet consectetur adipisicing elit. Magnam pariatur commodi ipsum ex quam eius voluptatibus fugit vero, consectetur explicabo cum magni fugiat natus.</div>
<div class="panel">Lorem, ipsum dolor sit amet consectetur adipisicing elit.</div>
<div class="panel">this is a test</div>
<div class="panel">Lorem ipsum dolor sit amet consectetur adipisicing elit. Nulla, commodi a!</div>
<div class="panel">Lorem ipsum dolor sit amet consectetur, adipisicing elit. Saepe, nihil pariatur enim, porro temporibus harum, quo omnis beatae eaque soluta totam ipsa?</div>
</div>








html 
font-family: Arial, sans-serif;


*,
*:before,
*:after
box-sizing: border-box;
border: none;
margin: 0;
padding: 0;


body
background: #333;
color: #333;


.container
background: firebrick;
display: flex;
flex-flow: column;
height: 50rem;
margin: 0 auto;
padding: 1rem;
width: 30rem;


.panel
background: white;
padding: 1rem;


.panel:nth-child(even)
background: lightgrey;

<div class="container">
<div class="panel">Lorem ipsum dolor sit amet consectetur adipisicing elit. Magnam pariatur commodi ipsum ex quam eius voluptatibus fugit vero, consectetur explicabo cum magni fugiat natus.</div>
<div class="panel">Lorem, ipsum dolor sit amet consectetur adipisicing elit.</div>
<div class="panel">this is a test</div>
<div class="panel">Lorem ipsum dolor sit amet consectetur adipisicing elit. Nulla, commodi a!</div>
<div class="panel">Lorem ipsum dolor sit amet consectetur, adipisicing elit. Saepe, nihil pariatur enim, porro temporibus harum, quo omnis beatae eaque soluta totam ipsa?</div>
</div>





html 
font-family: Arial, sans-serif;


*,
*:before,
*:after
box-sizing: border-box;
border: none;
margin: 0;
padding: 0;


body
background: #333;
color: #333;


.container
background: firebrick;
display: flex;
flex-flow: column;
height: 50rem;
margin: 0 auto;
padding: 1rem;
width: 30rem;


.panel
background: white;
padding: 1rem;


.panel:nth-child(even)
background: lightgrey;

<div class="container">
<div class="panel">Lorem ipsum dolor sit amet consectetur adipisicing elit. Magnam pariatur commodi ipsum ex quam eius voluptatibus fugit vero, consectetur explicabo cum magni fugiat natus.</div>
<div class="panel">Lorem, ipsum dolor sit amet consectetur adipisicing elit.</div>
<div class="panel">this is a test</div>
<div class="panel">Lorem ipsum dolor sit amet consectetur adipisicing elit. Nulla, commodi a!</div>
<div class="panel">Lorem ipsum dolor sit amet consectetur, adipisicing elit. Saepe, nihil pariatur enim, porro temporibus harum, quo omnis beatae eaque soluta totam ipsa?</div>
</div>






html css flexbox






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 9 at 17:41









Outrigger

276




276











  • refer to this, its' very clear css-tricks.com/snippets/css/a-guide-to-flexbox
    – DaFois
    Nov 9 at 17:45
















  • refer to this, its' very clear css-tricks.com/snippets/css/a-guide-to-flexbox
    – DaFois
    Nov 9 at 17:45















refer to this, its' very clear css-tricks.com/snippets/css/a-guide-to-flexbox
– DaFois
Nov 9 at 17:45




refer to this, its' very clear css-tricks.com/snippets/css/a-guide-to-flexbox
– DaFois
Nov 9 at 17:45












3 Answers
3






active

oldest

votes


















1














The simple answer is "no". Flexbox distributes space among flex items based on the size of the container, not the size of a particular sibling. You'll need to use a script.






share|improve this answer






























    0














    If you don't mind them stretching to fit container height you can set children flex-basis to 20%:






    html 
    font-family: Arial, sans-serif;


    *,
    *:before,
    *:after
    box-sizing: border-box;
    border: none;
    margin: 0;
    padding: 0;


    body
    background: #333;
    color: #333;


    .container
    background: firebrick;
    display: flex;
    flex-flow: column;
    height: 50rem;
    margin: 0 auto;
    padding: 1rem;
    width: 30rem;


    .panel
    background: white;
    padding: 1rem;
    flex-basis: 20%;


    .panel:nth-child(even)
    background: lightgrey;

    <div class="container">
    <div class="panel">Lorem ipsum dolor sit amet consectetur adipisicing elit. Magnam pariatur commodi ipsum ex quam eius voluptatibus fugit vero, consectetur explicabo cum magni fugiat natus.</div>
    <div class="panel">Lorem, ipsum dolor sit amet consectetur adipisicing elit.</div>
    <div class="panel">this is a test</div>
    <div class="panel">Lorem ipsum dolor sit amet consectetur adipisicing elit. Nulla, commodi a!</div>
    <div class="panel">Lorem ipsum dolor sit amet consectetur, adipisicing elit. Saepe, nihil pariatur enim, porro temporibus harum, quo omnis beatae eaque soluta totam ipsa?</div>
    </div>








    share|improve this answer




















    • Oh I see its set to 20% because there are 5 panels, right?
      – Raqem
      Nov 9 at 21:02










    • This solution doesn't address the problem, which is to make items equal the height of the tallest sibling.
      – Michael_B
      Nov 9 at 22:09











    • @Raqem Exactly, if this is not a nice solution for you, you probably need to use javascript to dynamically get the tallest panel height and set all panels that high
      – Becks
      Nov 12 at 9:59


















    -1














    You can do this with flex-basis, with the catch that you have to know how many children there will be. You can also use flex-grow, but that only distributes the extra space available, so the tallest elements will still be taller than the shorter ones:






    html 
    font-family: Arial, sans-serif;


    *,
    *:before,
    *:after
    box-sizing: border-box;
    border: none;
    margin: 0;
    padding: 0;


    body
    background: #333;
    color: #333;


    .container
    background: firebrick;
    display: flex;
    flex-flow: column;
    height: 50rem;
    margin: 0 auto;
    padding: 1rem;
    width: 30rem;


    .panel
    background: white;
    padding: 1rem;
    flex-basis: 20%;


    .panel:nth-child(even)
    background: lightgrey;

    <div class="container">
    <div class="panel">Lorem ipsum dolor sit amet consectetur adipisicing elit. Magnam pariatur commodi ipsum ex quam eius voluptatibus fugit vero, consectetur explicabo cum magni fugiat natus.</div>
    <div class="panel">Lorem, ipsum dolor sit amet consectetur adipisicing elit.</div>
    <div class="panel">this is a test</div>
    <div class="panel">Lorem ipsum dolor sit amet consectetur adipisicing elit. Nulla, commodi a!</div>
    <div class="panel">Lorem ipsum dolor sit amet consectetur, adipisicing elit. Saepe, nihil pariatur enim, porro temporibus harum, quo omnis beatae eaque soluta totam ipsa?</div>
    </div>








    share|improve this answer




















    • This solution doesn't address the problem, which is to make items equal the height of the tallest sibling.
      – Michael_B
      Nov 9 at 22:11










    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53230821%2fis-it-possible-to-make-all-the-children-of-a-flex-flow-column-flexbox-the-sam%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    3 Answers
    3






    active

    oldest

    votes








    3 Answers
    3






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    The simple answer is "no". Flexbox distributes space among flex items based on the size of the container, not the size of a particular sibling. You'll need to use a script.






    share|improve this answer



























      1














      The simple answer is "no". Flexbox distributes space among flex items based on the size of the container, not the size of a particular sibling. You'll need to use a script.






      share|improve this answer

























        1












        1








        1






        The simple answer is "no". Flexbox distributes space among flex items based on the size of the container, not the size of a particular sibling. You'll need to use a script.






        share|improve this answer














        The simple answer is "no". Flexbox distributes space among flex items based on the size of the container, not the size of a particular sibling. You'll need to use a script.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Nov 9 at 22:12

























        answered Nov 9 at 19:48









        Michael_B

        144k47228337




        144k47228337























            0














            If you don't mind them stretching to fit container height you can set children flex-basis to 20%:






            html 
            font-family: Arial, sans-serif;


            *,
            *:before,
            *:after
            box-sizing: border-box;
            border: none;
            margin: 0;
            padding: 0;


            body
            background: #333;
            color: #333;


            .container
            background: firebrick;
            display: flex;
            flex-flow: column;
            height: 50rem;
            margin: 0 auto;
            padding: 1rem;
            width: 30rem;


            .panel
            background: white;
            padding: 1rem;
            flex-basis: 20%;


            .panel:nth-child(even)
            background: lightgrey;

            <div class="container">
            <div class="panel">Lorem ipsum dolor sit amet consectetur adipisicing elit. Magnam pariatur commodi ipsum ex quam eius voluptatibus fugit vero, consectetur explicabo cum magni fugiat natus.</div>
            <div class="panel">Lorem, ipsum dolor sit amet consectetur adipisicing elit.</div>
            <div class="panel">this is a test</div>
            <div class="panel">Lorem ipsum dolor sit amet consectetur adipisicing elit. Nulla, commodi a!</div>
            <div class="panel">Lorem ipsum dolor sit amet consectetur, adipisicing elit. Saepe, nihil pariatur enim, porro temporibus harum, quo omnis beatae eaque soluta totam ipsa?</div>
            </div>








            share|improve this answer




















            • Oh I see its set to 20% because there are 5 panels, right?
              – Raqem
              Nov 9 at 21:02










            • This solution doesn't address the problem, which is to make items equal the height of the tallest sibling.
              – Michael_B
              Nov 9 at 22:09











            • @Raqem Exactly, if this is not a nice solution for you, you probably need to use javascript to dynamically get the tallest panel height and set all panels that high
              – Becks
              Nov 12 at 9:59















            0














            If you don't mind them stretching to fit container height you can set children flex-basis to 20%:






            html 
            font-family: Arial, sans-serif;


            *,
            *:before,
            *:after
            box-sizing: border-box;
            border: none;
            margin: 0;
            padding: 0;


            body
            background: #333;
            color: #333;


            .container
            background: firebrick;
            display: flex;
            flex-flow: column;
            height: 50rem;
            margin: 0 auto;
            padding: 1rem;
            width: 30rem;


            .panel
            background: white;
            padding: 1rem;
            flex-basis: 20%;


            .panel:nth-child(even)
            background: lightgrey;

            <div class="container">
            <div class="panel">Lorem ipsum dolor sit amet consectetur adipisicing elit. Magnam pariatur commodi ipsum ex quam eius voluptatibus fugit vero, consectetur explicabo cum magni fugiat natus.</div>
            <div class="panel">Lorem, ipsum dolor sit amet consectetur adipisicing elit.</div>
            <div class="panel">this is a test</div>
            <div class="panel">Lorem ipsum dolor sit amet consectetur adipisicing elit. Nulla, commodi a!</div>
            <div class="panel">Lorem ipsum dolor sit amet consectetur, adipisicing elit. Saepe, nihil pariatur enim, porro temporibus harum, quo omnis beatae eaque soluta totam ipsa?</div>
            </div>








            share|improve this answer




















            • Oh I see its set to 20% because there are 5 panels, right?
              – Raqem
              Nov 9 at 21:02










            • This solution doesn't address the problem, which is to make items equal the height of the tallest sibling.
              – Michael_B
              Nov 9 at 22:09











            • @Raqem Exactly, if this is not a nice solution for you, you probably need to use javascript to dynamically get the tallest panel height and set all panels that high
              – Becks
              Nov 12 at 9:59













            0












            0








            0






            If you don't mind them stretching to fit container height you can set children flex-basis to 20%:






            html 
            font-family: Arial, sans-serif;


            *,
            *:before,
            *:after
            box-sizing: border-box;
            border: none;
            margin: 0;
            padding: 0;


            body
            background: #333;
            color: #333;


            .container
            background: firebrick;
            display: flex;
            flex-flow: column;
            height: 50rem;
            margin: 0 auto;
            padding: 1rem;
            width: 30rem;


            .panel
            background: white;
            padding: 1rem;
            flex-basis: 20%;


            .panel:nth-child(even)
            background: lightgrey;

            <div class="container">
            <div class="panel">Lorem ipsum dolor sit amet consectetur adipisicing elit. Magnam pariatur commodi ipsum ex quam eius voluptatibus fugit vero, consectetur explicabo cum magni fugiat natus.</div>
            <div class="panel">Lorem, ipsum dolor sit amet consectetur adipisicing elit.</div>
            <div class="panel">this is a test</div>
            <div class="panel">Lorem ipsum dolor sit amet consectetur adipisicing elit. Nulla, commodi a!</div>
            <div class="panel">Lorem ipsum dolor sit amet consectetur, adipisicing elit. Saepe, nihil pariatur enim, porro temporibus harum, quo omnis beatae eaque soluta totam ipsa?</div>
            </div>








            share|improve this answer












            If you don't mind them stretching to fit container height you can set children flex-basis to 20%:






            html 
            font-family: Arial, sans-serif;


            *,
            *:before,
            *:after
            box-sizing: border-box;
            border: none;
            margin: 0;
            padding: 0;


            body
            background: #333;
            color: #333;


            .container
            background: firebrick;
            display: flex;
            flex-flow: column;
            height: 50rem;
            margin: 0 auto;
            padding: 1rem;
            width: 30rem;


            .panel
            background: white;
            padding: 1rem;
            flex-basis: 20%;


            .panel:nth-child(even)
            background: lightgrey;

            <div class="container">
            <div class="panel">Lorem ipsum dolor sit amet consectetur adipisicing elit. Magnam pariatur commodi ipsum ex quam eius voluptatibus fugit vero, consectetur explicabo cum magni fugiat natus.</div>
            <div class="panel">Lorem, ipsum dolor sit amet consectetur adipisicing elit.</div>
            <div class="panel">this is a test</div>
            <div class="panel">Lorem ipsum dolor sit amet consectetur adipisicing elit. Nulla, commodi a!</div>
            <div class="panel">Lorem ipsum dolor sit amet consectetur, adipisicing elit. Saepe, nihil pariatur enim, porro temporibus harum, quo omnis beatae eaque soluta totam ipsa?</div>
            </div>








            html 
            font-family: Arial, sans-serif;


            *,
            *:before,
            *:after
            box-sizing: border-box;
            border: none;
            margin: 0;
            padding: 0;


            body
            background: #333;
            color: #333;


            .container
            background: firebrick;
            display: flex;
            flex-flow: column;
            height: 50rem;
            margin: 0 auto;
            padding: 1rem;
            width: 30rem;


            .panel
            background: white;
            padding: 1rem;
            flex-basis: 20%;


            .panel:nth-child(even)
            background: lightgrey;

            <div class="container">
            <div class="panel">Lorem ipsum dolor sit amet consectetur adipisicing elit. Magnam pariatur commodi ipsum ex quam eius voluptatibus fugit vero, consectetur explicabo cum magni fugiat natus.</div>
            <div class="panel">Lorem, ipsum dolor sit amet consectetur adipisicing elit.</div>
            <div class="panel">this is a test</div>
            <div class="panel">Lorem ipsum dolor sit amet consectetur adipisicing elit. Nulla, commodi a!</div>
            <div class="panel">Lorem ipsum dolor sit amet consectetur, adipisicing elit. Saepe, nihil pariatur enim, porro temporibus harum, quo omnis beatae eaque soluta totam ipsa?</div>
            </div>





            html 
            font-family: Arial, sans-serif;


            *,
            *:before,
            *:after
            box-sizing: border-box;
            border: none;
            margin: 0;
            padding: 0;


            body
            background: #333;
            color: #333;


            .container
            background: firebrick;
            display: flex;
            flex-flow: column;
            height: 50rem;
            margin: 0 auto;
            padding: 1rem;
            width: 30rem;


            .panel
            background: white;
            padding: 1rem;
            flex-basis: 20%;


            .panel:nth-child(even)
            background: lightgrey;

            <div class="container">
            <div class="panel">Lorem ipsum dolor sit amet consectetur adipisicing elit. Magnam pariatur commodi ipsum ex quam eius voluptatibus fugit vero, consectetur explicabo cum magni fugiat natus.</div>
            <div class="panel">Lorem, ipsum dolor sit amet consectetur adipisicing elit.</div>
            <div class="panel">this is a test</div>
            <div class="panel">Lorem ipsum dolor sit amet consectetur adipisicing elit. Nulla, commodi a!</div>
            <div class="panel">Lorem ipsum dolor sit amet consectetur, adipisicing elit. Saepe, nihil pariatur enim, porro temporibus harum, quo omnis beatae eaque soluta totam ipsa?</div>
            </div>






            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Nov 9 at 18:01









            Becks

            342210




            342210











            • Oh I see its set to 20% because there are 5 panels, right?
              – Raqem
              Nov 9 at 21:02










            • This solution doesn't address the problem, which is to make items equal the height of the tallest sibling.
              – Michael_B
              Nov 9 at 22:09











            • @Raqem Exactly, if this is not a nice solution for you, you probably need to use javascript to dynamically get the tallest panel height and set all panels that high
              – Becks
              Nov 12 at 9:59
















            • Oh I see its set to 20% because there are 5 panels, right?
              – Raqem
              Nov 9 at 21:02










            • This solution doesn't address the problem, which is to make items equal the height of the tallest sibling.
              – Michael_B
              Nov 9 at 22:09











            • @Raqem Exactly, if this is not a nice solution for you, you probably need to use javascript to dynamically get the tallest panel height and set all panels that high
              – Becks
              Nov 12 at 9:59















            Oh I see its set to 20% because there are 5 panels, right?
            – Raqem
            Nov 9 at 21:02




            Oh I see its set to 20% because there are 5 panels, right?
            – Raqem
            Nov 9 at 21:02












            This solution doesn't address the problem, which is to make items equal the height of the tallest sibling.
            – Michael_B
            Nov 9 at 22:09





            This solution doesn't address the problem, which is to make items equal the height of the tallest sibling.
            – Michael_B
            Nov 9 at 22:09













            @Raqem Exactly, if this is not a nice solution for you, you probably need to use javascript to dynamically get the tallest panel height and set all panels that high
            – Becks
            Nov 12 at 9:59




            @Raqem Exactly, if this is not a nice solution for you, you probably need to use javascript to dynamically get the tallest panel height and set all panels that high
            – Becks
            Nov 12 at 9:59











            -1














            You can do this with flex-basis, with the catch that you have to know how many children there will be. You can also use flex-grow, but that only distributes the extra space available, so the tallest elements will still be taller than the shorter ones:






            html 
            font-family: Arial, sans-serif;


            *,
            *:before,
            *:after
            box-sizing: border-box;
            border: none;
            margin: 0;
            padding: 0;


            body
            background: #333;
            color: #333;


            .container
            background: firebrick;
            display: flex;
            flex-flow: column;
            height: 50rem;
            margin: 0 auto;
            padding: 1rem;
            width: 30rem;


            .panel
            background: white;
            padding: 1rem;
            flex-basis: 20%;


            .panel:nth-child(even)
            background: lightgrey;

            <div class="container">
            <div class="panel">Lorem ipsum dolor sit amet consectetur adipisicing elit. Magnam pariatur commodi ipsum ex quam eius voluptatibus fugit vero, consectetur explicabo cum magni fugiat natus.</div>
            <div class="panel">Lorem, ipsum dolor sit amet consectetur adipisicing elit.</div>
            <div class="panel">this is a test</div>
            <div class="panel">Lorem ipsum dolor sit amet consectetur adipisicing elit. Nulla, commodi a!</div>
            <div class="panel">Lorem ipsum dolor sit amet consectetur, adipisicing elit. Saepe, nihil pariatur enim, porro temporibus harum, quo omnis beatae eaque soluta totam ipsa?</div>
            </div>








            share|improve this answer




















            • This solution doesn't address the problem, which is to make items equal the height of the tallest sibling.
              – Michael_B
              Nov 9 at 22:11















            -1














            You can do this with flex-basis, with the catch that you have to know how many children there will be. You can also use flex-grow, but that only distributes the extra space available, so the tallest elements will still be taller than the shorter ones:






            html 
            font-family: Arial, sans-serif;


            *,
            *:before,
            *:after
            box-sizing: border-box;
            border: none;
            margin: 0;
            padding: 0;


            body
            background: #333;
            color: #333;


            .container
            background: firebrick;
            display: flex;
            flex-flow: column;
            height: 50rem;
            margin: 0 auto;
            padding: 1rem;
            width: 30rem;


            .panel
            background: white;
            padding: 1rem;
            flex-basis: 20%;


            .panel:nth-child(even)
            background: lightgrey;

            <div class="container">
            <div class="panel">Lorem ipsum dolor sit amet consectetur adipisicing elit. Magnam pariatur commodi ipsum ex quam eius voluptatibus fugit vero, consectetur explicabo cum magni fugiat natus.</div>
            <div class="panel">Lorem, ipsum dolor sit amet consectetur adipisicing elit.</div>
            <div class="panel">this is a test</div>
            <div class="panel">Lorem ipsum dolor sit amet consectetur adipisicing elit. Nulla, commodi a!</div>
            <div class="panel">Lorem ipsum dolor sit amet consectetur, adipisicing elit. Saepe, nihil pariatur enim, porro temporibus harum, quo omnis beatae eaque soluta totam ipsa?</div>
            </div>








            share|improve this answer




















            • This solution doesn't address the problem, which is to make items equal the height of the tallest sibling.
              – Michael_B
              Nov 9 at 22:11













            -1












            -1








            -1






            You can do this with flex-basis, with the catch that you have to know how many children there will be. You can also use flex-grow, but that only distributes the extra space available, so the tallest elements will still be taller than the shorter ones:






            html 
            font-family: Arial, sans-serif;


            *,
            *:before,
            *:after
            box-sizing: border-box;
            border: none;
            margin: 0;
            padding: 0;


            body
            background: #333;
            color: #333;


            .container
            background: firebrick;
            display: flex;
            flex-flow: column;
            height: 50rem;
            margin: 0 auto;
            padding: 1rem;
            width: 30rem;


            .panel
            background: white;
            padding: 1rem;
            flex-basis: 20%;


            .panel:nth-child(even)
            background: lightgrey;

            <div class="container">
            <div class="panel">Lorem ipsum dolor sit amet consectetur adipisicing elit. Magnam pariatur commodi ipsum ex quam eius voluptatibus fugit vero, consectetur explicabo cum magni fugiat natus.</div>
            <div class="panel">Lorem, ipsum dolor sit amet consectetur adipisicing elit.</div>
            <div class="panel">this is a test</div>
            <div class="panel">Lorem ipsum dolor sit amet consectetur adipisicing elit. Nulla, commodi a!</div>
            <div class="panel">Lorem ipsum dolor sit amet consectetur, adipisicing elit. Saepe, nihil pariatur enim, porro temporibus harum, quo omnis beatae eaque soluta totam ipsa?</div>
            </div>








            share|improve this answer












            You can do this with flex-basis, with the catch that you have to know how many children there will be. You can also use flex-grow, but that only distributes the extra space available, so the tallest elements will still be taller than the shorter ones:






            html 
            font-family: Arial, sans-serif;


            *,
            *:before,
            *:after
            box-sizing: border-box;
            border: none;
            margin: 0;
            padding: 0;


            body
            background: #333;
            color: #333;


            .container
            background: firebrick;
            display: flex;
            flex-flow: column;
            height: 50rem;
            margin: 0 auto;
            padding: 1rem;
            width: 30rem;


            .panel
            background: white;
            padding: 1rem;
            flex-basis: 20%;


            .panel:nth-child(even)
            background: lightgrey;

            <div class="container">
            <div class="panel">Lorem ipsum dolor sit amet consectetur adipisicing elit. Magnam pariatur commodi ipsum ex quam eius voluptatibus fugit vero, consectetur explicabo cum magni fugiat natus.</div>
            <div class="panel">Lorem, ipsum dolor sit amet consectetur adipisicing elit.</div>
            <div class="panel">this is a test</div>
            <div class="panel">Lorem ipsum dolor sit amet consectetur adipisicing elit. Nulla, commodi a!</div>
            <div class="panel">Lorem ipsum dolor sit amet consectetur, adipisicing elit. Saepe, nihil pariatur enim, porro temporibus harum, quo omnis beatae eaque soluta totam ipsa?</div>
            </div>








            html 
            font-family: Arial, sans-serif;


            *,
            *:before,
            *:after
            box-sizing: border-box;
            border: none;
            margin: 0;
            padding: 0;


            body
            background: #333;
            color: #333;


            .container
            background: firebrick;
            display: flex;
            flex-flow: column;
            height: 50rem;
            margin: 0 auto;
            padding: 1rem;
            width: 30rem;


            .panel
            background: white;
            padding: 1rem;
            flex-basis: 20%;


            .panel:nth-child(even)
            background: lightgrey;

            <div class="container">
            <div class="panel">Lorem ipsum dolor sit amet consectetur adipisicing elit. Magnam pariatur commodi ipsum ex quam eius voluptatibus fugit vero, consectetur explicabo cum magni fugiat natus.</div>
            <div class="panel">Lorem, ipsum dolor sit amet consectetur adipisicing elit.</div>
            <div class="panel">this is a test</div>
            <div class="panel">Lorem ipsum dolor sit amet consectetur adipisicing elit. Nulla, commodi a!</div>
            <div class="panel">Lorem ipsum dolor sit amet consectetur, adipisicing elit. Saepe, nihil pariatur enim, porro temporibus harum, quo omnis beatae eaque soluta totam ipsa?</div>
            </div>





            html 
            font-family: Arial, sans-serif;


            *,
            *:before,
            *:after
            box-sizing: border-box;
            border: none;
            margin: 0;
            padding: 0;


            body
            background: #333;
            color: #333;


            .container
            background: firebrick;
            display: flex;
            flex-flow: column;
            height: 50rem;
            margin: 0 auto;
            padding: 1rem;
            width: 30rem;


            .panel
            background: white;
            padding: 1rem;
            flex-basis: 20%;


            .panel:nth-child(even)
            background: lightgrey;

            <div class="container">
            <div class="panel">Lorem ipsum dolor sit amet consectetur adipisicing elit. Magnam pariatur commodi ipsum ex quam eius voluptatibus fugit vero, consectetur explicabo cum magni fugiat natus.</div>
            <div class="panel">Lorem, ipsum dolor sit amet consectetur adipisicing elit.</div>
            <div class="panel">this is a test</div>
            <div class="panel">Lorem ipsum dolor sit amet consectetur adipisicing elit. Nulla, commodi a!</div>
            <div class="panel">Lorem ipsum dolor sit amet consectetur, adipisicing elit. Saepe, nihil pariatur enim, porro temporibus harum, quo omnis beatae eaque soluta totam ipsa?</div>
            </div>






            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Nov 9 at 18:01









            nvioli

            2,30131228




            2,30131228











            • This solution doesn't address the problem, which is to make items equal the height of the tallest sibling.
              – Michael_B
              Nov 9 at 22:11
















            • This solution doesn't address the problem, which is to make items equal the height of the tallest sibling.
              – Michael_B
              Nov 9 at 22:11















            This solution doesn't address the problem, which is to make items equal the height of the tallest sibling.
            – Michael_B
            Nov 9 at 22:11




            This solution doesn't address the problem, which is to make items equal the height of the tallest sibling.
            – Michael_B
            Nov 9 at 22:11

















            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53230821%2fis-it-possible-to-make-all-the-children-of-a-flex-flow-column-flexbox-the-sam%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            𛂒𛀶,𛀽𛀑𛂀𛃧𛂓𛀙𛃆𛃑𛃷𛂟𛁡𛀢𛀟𛁤𛂽𛁕𛁪𛂟𛂯,𛁞𛂧𛀴𛁄𛁠𛁼𛂿𛀤 𛂘,𛁺𛂾𛃭𛃭𛃵𛀺,𛂣𛃍𛂖𛃶 𛀸𛃀𛂖𛁶𛁏𛁚 𛂢𛂞 𛁰𛂆𛀔,𛁸𛀽𛁓𛃋𛂇𛃧𛀧𛃣𛂐𛃇,𛂂𛃻𛃲𛁬𛃞𛀧𛃃𛀅 𛂭𛁠𛁡𛃇𛀷𛃓𛁥,𛁙𛁘𛁞𛃸𛁸𛃣𛁜,𛂛,𛃿,𛁯𛂘𛂌𛃛𛁱𛃌𛂈𛂇 𛁊𛃲,𛀕𛃴𛀜 𛀶𛂆𛀶𛃟𛂉𛀣,𛂐𛁞𛁾 𛁷𛂑𛁳𛂯𛀬𛃅,𛃶𛁼

            Edmonton

            Crossroads (UK TV series)