为什么 ie8 的缩放以不同的比例扩展 div 与扩展文本?
基本上,当我放大文本时,它会弄乱我的格式。文本缩放比例似乎与黄色框缩放比例不同。
谁能告诉我为什么会发生这种情况?
下面是示例代码:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"/>
<meta http-equiv="Expires" content="-1"/>
<style>
.highlightLine
{
filter: alpha(opacity=50);
opacity: 0.5;
background-color: #e8e800;
position: absolute;
z-index: 1;
-moz-user-select: none;
}
.clickAbleTable
{
border-width: 0px;
border-collapse: collapse;
position: relative;
}
.zeroAll
{
padding: 0px;
margin: 0px;
border: 0px;
}
</style>
</head>
<body class="zeroAll">
<DIV style="POSITION: absolute; FONT-SIZE: 100%" id=container name="container" class="zeroAll">
<TABLE style="WIDTH: 100%" class="clickAbleTable zeroAll">
<TBODY class="zeroAll">
<TR class="zeroAll">
<TD class="zeroAll"><PRE class="zeroAll">This is sample text. This is sample text. This is sample text. </PRE></TD></TR>
<TR class="zeroAll">
<TD class="zeroAll"><PRE class="zeroAll">This is sample text. This is sample text. This is sample text. </PRE></TD></TR>
<TR class="zeroAll">
<TD class="zeroAll"><PRE class="zeroAll">This is sample text. This is sample text. This is sample text. </PRE></TD></TR>
<TR class="zeroAll">
<TD class="zeroAll"><PRE class="zeroAll">This is sample text. This is sample text. This is sample text. </PRE></TD></TR>
<TR class="zeroAll">
<TD class="zeroAll"><PRE class="zeroAll">This is sample text. This is sample text. </PRE></TD></TR>
<TR class="zeroAll">
<TD class="zeroAll"><PRE class="zeroAll">This is sample text. This is sample text. </PRE></TD></TR>
<TR class="zeroAll">
<TD class="zeroAll"><PRE class="zeroAll">This is sample text. </PRE></TD></TR>
<TR class="zeroAll">
<TD class="zeroAll"><PRE class="zeroAll">This is sample text. </PRE></TD></TR>
<TR class="zeroAll">
<TD class="zeroAll"><PRE class="zeroAll">This is sample text. This is sample text. This is sample text. </PRE></TD></TR>
<TR class="zeroAll">
<TD class="zeroAll"><PRE class="zeroAll">This is sample text. This is sample text. This is sample text. </PRE></TD></TR>
</TBODY>
</TABLE>
<DIV style="WIDTH: 10px; DISPLAY: block; HEIGHT: 100%; TOP: 0px; LEFT: 140px" id=colMark_80_4 class=highlightLine>
</DIV>
<DIV style="WIDTH: 10px; DISPLAY: block; HEIGHT: 100%; TOP: 0px; LEFT: 5.55%" id=colMark_80_5 class=highlightLine>
</DIV>
</DIV>
</body>
</html>
注意:黄线应位于“sample”一词的两侧。
Basically, when I zoom in on text it messes up my formatting. It seems like the text zoom zoom at a different rate than the yellow box zoom.
Can anyone tell me why this is happening?
Below is the sample code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"/>
<meta http-equiv="Expires" content="-1"/>
<style>
.highlightLine
{
filter: alpha(opacity=50);
opacity: 0.5;
background-color: #e8e800;
position: absolute;
z-index: 1;
-moz-user-select: none;
}
.clickAbleTable
{
border-width: 0px;
border-collapse: collapse;
position: relative;
}
.zeroAll
{
padding: 0px;
margin: 0px;
border: 0px;
}
</style>
</head>
<body class="zeroAll">
<DIV style="POSITION: absolute; FONT-SIZE: 100%" id=container name="container" class="zeroAll">
<TABLE style="WIDTH: 100%" class="clickAbleTable zeroAll">
<TBODY class="zeroAll">
<TR class="zeroAll">
<TD class="zeroAll"><PRE class="zeroAll">This is sample text. This is sample text. This is sample text. </PRE></TD></TR>
<TR class="zeroAll">
<TD class="zeroAll"><PRE class="zeroAll">This is sample text. This is sample text. This is sample text. </PRE></TD></TR>
<TR class="zeroAll">
<TD class="zeroAll"><PRE class="zeroAll">This is sample text. This is sample text. This is sample text. </PRE></TD></TR>
<TR class="zeroAll">
<TD class="zeroAll"><PRE class="zeroAll">This is sample text. This is sample text. This is sample text. </PRE></TD></TR>
<TR class="zeroAll">
<TD class="zeroAll"><PRE class="zeroAll">This is sample text. This is sample text. </PRE></TD></TR>
<TR class="zeroAll">
<TD class="zeroAll"><PRE class="zeroAll">This is sample text. This is sample text. </PRE></TD></TR>
<TR class="zeroAll">
<TD class="zeroAll"><PRE class="zeroAll">This is sample text. </PRE></TD></TR>
<TR class="zeroAll">
<TD class="zeroAll"><PRE class="zeroAll">This is sample text. </PRE></TD></TR>
<TR class="zeroAll">
<TD class="zeroAll"><PRE class="zeroAll">This is sample text. This is sample text. This is sample text. </PRE></TD></TR>
<TR class="zeroAll">
<TD class="zeroAll"><PRE class="zeroAll">This is sample text. This is sample text. This is sample text. </PRE></TD></TR>
</TBODY>
</TABLE>
<DIV style="WIDTH: 10px; DISPLAY: block; HEIGHT: 100%; TOP: 0px; LEFT: 140px" id=colMark_80_4 class=highlightLine>
</DIV>
<DIV style="WIDTH: 10px; DISPLAY: block; HEIGHT: 100%; TOP: 0px; LEFT: 5.55%" id=colMark_80_5 class=highlightLine>
</DIV>
</DIV>
</body>
</html>
Note: The yellow lines should stay on either side of the word sample.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
IE 对于文本和静态元素与定位元素和浮动元素有不同的算法。 自适应缩放 算法对于文本和静态元素是这样工作的:
对于定位元素和浮动来说:
在 IE10 中使用以下元标记来修复 IE8 兼容模式下的缩放问题:
参考
IE has different algorithms for text and static elements versus positioned elements and floats. The adaptive zoom algorithm works as such for text and static elements:
And as such for positioned elements and floats:
Use the following meta tag in IE10 to fix the scaling while in IE8 compatibility mode:
References