我使用語義的用戶界面,並已成功地縮小了一些不確定的行爲在CSS屬性will-change
(我發現它在自己的模態的):CSS屬性會變化不確定的行爲
.outer{
background-color: black;
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
}
.inner{
position:absolute;
background-color: white;
left: 50%;
top: 100px;
width: 400px;
margin-left: -200px;
height: 100px;
padding: 5px;
/**
* comment out the line below
* to see the desired/different result
**/
will-change: transform;
}
.baby{
color: yellow;
position: fixed;
left: 20px;
top: 20px;
right: 0;
border: 1px solid red;
}
<div class="outer">
<div class="inner">
<div class="baby">here</div>
<div class="content">some content</div>
</div>
</div>
我只在鉻中測試過。有沒有人有關於這裏發生了什麼的更多信息?爲什麼will-change
對實際佈局做任何事情?
比我的更好的解釋:-) – vals
啊,所以我真正的問題實際上是沿着這條線:http://stackoverflow.com/questions/27952725/why-doesnt-translatex-work-as-expected - 對於固定的元素上-IE9-IE10和 - IE1 – Isaac