我在某处读到CSS表达式已被弃用,甚至不应该使用。我从来没有听说过他们,所以我决定去看看。我发现了一个代码示例,它将一个浮动元素保留在屏幕上的同一位置,即使您滚动。
<html>
<style>
#fixed {
position:absolute;
left:10px;
top:expression(body.scrollTop + 50 + "px");
background:white;
border:1px solid red;}
</style>
<body>
<p id="fixed">Here is some text, which is fixed.</p>
<p>
[many times: "stuff <br/>"]
</p>
</body>
</html>
这让我想起了那些在页面底部有“分享条”之类的东西的网站。
所以..。
https://stackoverflow.com/questions/6191679
复制相似问题