是否可以在我的CSS类中使用缩放:1? [英] Is it okay to use zoom:1 in my css classes?

查看:151
本文介绍了是否可以在我的CSS类中使用缩放:1?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每当我发现IE显示我的网站很奇怪(不同于chrome和firefox),我尝试放置一个缩放:1 在css类中的部分显示怪异。

Whenever I find IE is displaying my website weird (different from chrome and firefox), I try putting a zoom:1 in the css class for the part that is being displayed weird. A lot of the time this fixes the problem and makes it look consistent with the other browsers.

这是一个问题,使用 zoom:1 ?我知道我的CSS将无法验证,但是如果我太依赖使用 zoom:1 ?会出现任何现实世界的问题?

Is it a problem to use zoom:1? I know my CSS won't validate, but are there any real world problems that can arise if I rely too much on using zoom:1?

推荐答案

这个问题是IE hasLayout 问题。 这里是一篇很好的文章和概述,其中的属性也会在IE中触发有布局 。

The problem you are fighting with this is the IE hasLayout issue. Here is a good article and overview on which properties also trigger "having Layout" in IE.

我知道没有副作用到 zoom:1 ,除了它不是W3C有效。我很确定我在一些项目中自己使用它。

I know of no side-effects to zoom: 1 except that it's not W3C valid. I'm pretty sure I'm using it myself in some projects.

但是, zoom 当然有可能成为一个真正的CSS属性,在另一个专有的上下文,如在iPad上或任何 - 这可能导致事情打破。

However, there is of course the remote chance that zoom becomes a real CSS property one day - or gets used in another proprietary context like on the iPad or whatever - which could lead to things breaking.

真的干净的解决方案,如果可能的话,最好使用文章中概述的其他方式提供元素布局。

A really clean solution, zoom is not. If at all possible, it's a good idea to give the element "Layout" in some other way as outlined in the article.

这篇关于是否可以在我的CSS类中使用缩放:1?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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