html css equal div height

后端 未结 3 1138
暖寄归人
暖寄归人 2021-01-07 08:46

I have one container div which contain 2 dynamic height (height haven\'t been set) divs side by side , those 2 divs are content divs , sometimes one div have more content th

相关标签:
3条回答
  • 2021-01-07 09:31

    Or look into this: http://matthewjamestaylor.com/blog/equal-height-columns-cross-browser-css-no-hacks

    0 讨论(0)
  • 2021-01-07 09:42

    I don't think it is possible without Javascript for this situation. But you can handle if you use tables.

    0 讨论(0)
  • 2021-01-07 09:49

    You can use display:table property for this:

    .parent{
        width:100px;
        display:table;
        border:1px solid green;
    }
    .child{
        width:50px;
        background:blue;
        display:table-cell;
    }
    .child + .child{background:red;}
    

    http://jsfiddle.net/Vbkhq/7/

    0 讨论(0)
提交回复
热议问题