跨浏览器CSS的等高列 [英] Equal Height Columns with Cross-Browser CSS

查看:57
本文介绍了跨浏览器CSS的等高列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望具有相同高度的div.

I want to have divs of the same height.

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

之所以不起作用,是因为我的div具有边框,并且所描述的方法假定它们没有边框.

does not work for be because my divs have a border, and the method described assumes, that they have not.

我无法使用jQuery解决方案,因为由于ajax和菜单单击,我的div调整了大小,并且我找不到与此相关的事件.

A jQuery solution I could not make work, because my divs resize late because of ajax and menu clicks and I can not find an event for this.

推荐答案

虽然该插件似乎不支持边框,但它确实支持填充.尝试将它们包装在另一个div中,然后将其填充设置为2px(或您想要边框的大小),然后将背景色应用于此新的div.

While it seems the plugin doesn't support borders, it does support padding. Try wrapping them in another div, and then setting a padding of 2px (or however big you want the border) and then just applying a background color to this new div.

并非最符合Web标准的友好方式,但可以使用该技巧.

Not the most web standards friendly, but it will allow you use the trick.

这篇关于跨浏览器CSS的等高列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆