【发布时间】:2019-02-09 01:05:13
【问题描述】:
不正确的缩放大小发生在 Webkit 浏览器中,即 Chrome、Safari。我使用的 Chrome 版本是 68。
演示:Codepen Link
@Kaiido 要求的代码
HTML:
<div class="test1"></div>
<div class="test2"></div>
CSS:
.test1 {
z-index: 100;
position: fixed;
top: 10px;
left: 10px;
width: 1px;
height: 1px;
background: blue;
transform-origin: top left;
transform: scale(100, 100);
}
.test2 {
position: absolute;
top: 0;
left: 0;
width: 100px;
height: 100px;
background: red;
}
在上面的链接中,如果您放大/缩小 chrome,您会看到比例大小不一定与 .test2 div 的固定大小匹配。我希望scale(100, 100) 的最终大小在缩放时与width:100px; height: 100px 的大小完全相同,但显然情况并非如此。
我也在retina mac 和pc 上测试过这个。这与 Chrome 中的行为相同。但是,相同的代码在 Firefox 中经过测试并且可以正常工作。
这是某种错误还是我遗漏了什么?谢谢。
【问题讨论】:
-
请将您的示例包含在问题本身中。
标签: css google-chrome css-transforms scaletransform