缩放有什么错误:1; 在 CSS 中修复?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6287023/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-30 00:43:47  来源:igfitidea点击:

What bug does zoom:1; fix in CSS?

cssinternet-explorerinternet-explorer-7internet-explorer-6

提问by Web_Designer

I have seen people apply the CSS property zoom: 1;on HTML elements.

我见过人们zoom: 1;在 HTML 元素上应用 CSS 属性。

Why do they do this, and what bug does it fix?

他们为什么这样做,它修复了什么错误?

回答by thirtydot

This provides an internal property known as hasLayoutin Internet Explorer versions 7 and lower.

这提供了hasLayout在 Internet Explorer 版本 7 及更低版本中已知的内部属性。

The definitive article on the subject is here: http://www.satzansatz.de/cssd/onhavinglayout.html

关于这个主题的权威文章在这里:http: //www.satzansatz.de/cssd/onhavelayout.html

A lot of Internet Explorer's rendering inconsistencies can be fixed by giving an element “layout.” In this article, the authors focus on some aspects of this complicated matter.

“Layout” is an IE/Win proprietary concept that determines how elements draw and bound their content, interact with and relate to other elements, and react on and transmit application/user events.

许多 Internet Explorer 的渲染不一致可以通过给元素“布局”来修复。在这篇文章中,作者主要关注这个复杂问题的某些方面。

“布局”是 IE/Win 专有概念,它确定元素如何绘制和绑定其内容、如何与其他元素交互和关联,以及如何对应用程序/用户事件做出反应和传输。



For an example of a specific bug that zoom: 1(and so hasLayout) helps to fix:

有关zoom: 1(等等hasLayout)有助于修复的特定错误的示例:

Inline block doesn't work in internet explorer 7, 6

内联块在 Internet Explorer 7、6 中不起作用