same height of columns with 960.gs?

亡梦爱人 提交于 2019-12-11 03:34:57

问题


i've got 4 columns in one row and depending on how much information i put in each of them they will have different heights. you can see that if you put a background color on them.

how do i give the other columns the height of the column with the largest height?


回答1:


You can use jQuery to do this. http://www.cssnewbie.com/equal-height-columns-with-jquery/

Alternaively for a CSS only approach you can make it look like they are the same height, by wrapping all columns in a div, and then applying a single background image, with 4 blocks of colour that match the column widths.

This wrapper div will expand to be the size of the largest column, and will give the impression of 4 equal sized cols.




回答2:


Well, I don't know if this works for 960, but in Blueprint you can get that by applying the following style to the columns:

padding-bottom : 20000px;
margin-bottom : -20000px;
overflow:hidden;



回答3:


You could use CSS property display: table-cell

http://jsfiddle.net/AGjBM/

<style>
    div.table-cell {
        display: table-cell;
        border: 1px solid;
    }
</style>

    <div class="table-cell">
        Some Text
    </div>
    <div class="table-cell">
        Some Text<br>
        Some More Text
    </div>


来源:https://stackoverflow.com/questions/2168573/same-height-of-columns-with-960-gs

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!