跨浏览器CSS最小高度

As you know, Internet Explorer 6 does not follow CSS' "min-height" property. Luckily, we can fix this problem using the following CSS code snippet:

如您所知,Internet Explorer 6不遵循CSS的“最小高度”属性。 幸运的是,我们可以使用以下CSS代码片段解决此问题:

#container  { min-height:500px; } * html #container { height:500px; }

Internet Explorer 6 is the only browser that recongizes the "* html _____" selector and thus is the only browser to read the hard-set height. Since IE6 also stretches down despite the hard-set height property, you can view IE6's idea of "height" as a min-height. The only drawback to using this code is that it's not valid CSS. Functionality first though, right?

Internet Explorer 6是唯一能够识别“ * html _____”选择器的浏览器,因此是唯一读取硬设置高度的浏览器。 尽管IE6设置了硬性设置的height属性,但由于IE6也向下拉伸,因此您可以将IE6的“高度”概念视为最小高度。 使用此代码的唯一缺点是它不是有效CSS。 功能先行吧?

翻译自: https://davidwalsh.name/cross-browser-css-min-height

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值