在IE7中的box-sizing支持 [英] box-sizing support in IE7

查看:673
本文介绍了在IE7中的box-sizing支持的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚发现了 box-sizing:border-box CSS属性,它解决了一堆跨浏览器布局问题。

I just discovered the box-sizing: border-box CSS property which solves a bunch of cross browser layout problems for me.

我现在唯一的问题是IE7似乎不支持它。是否有一个黑客要获得IE7支持它?

The only issue I now have is that IE7 doesn't seem to support it. Is there a hack to get IE7 to support it?

推荐答案

我假设你使用这个来绕过IE6箱模型。不幸的是,实际上没有一般的方法来诱骗早期版本的IE支持任意的CSS属性。

I'm assuming you're using this to get around the IE6 box model. Unfortunately, there really is no general way to trick earlier versions of IE into supporting arbitrary CSS properties.

我建议不要使用 属性,因为除IE6之外的每个浏览器都将正确实现框模型。 维基百科文章能很好地解释IE6的区别。

I would recommend not using the box-sizing property, because every browser other than IE6 will implement the box model correctly. The Wikipedia article does a good job of explaining how IE6 differs.

为了解决这个问题,我建议使用单独的样式表为IE6,并包括它使用 IE条件注释。在您的IE6样式表中,您可以指定不同的宽度/高度/填充/边距,使您的布局看起来一致。您可以像这样为IE6添加样式表:

To solve this, I recommend using a separate style sheet for IE6, and including it using IE conditional comments. In your IE6 style sheet, you can specify different widths/heights/padding/margins to make your layout look consistent. You can include a style sheet for IE6 only like this:

<!--[if IE 6]>
  <link href="ie6sucks.css" rel="stylesheet" type="text/css" />
<![endif]-->

这篇关于在IE7中的box-sizing支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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