[在Chrome和Safari中查看此jsfiddle,了解我的意思:http://jsfiddle.net/y2dg65y7/3/

问题描述 投票:18回答:2
<div class="wrapper"> <div class="inner"> Why is cut off in Safari? </div> </div> .wrapper{ background-color: red; width: 200px; overflow: hidden; height: 400px; position: fixed; } .inner{ background-color: silver; padding: 20px; width: 400px; height: 200px; position: fixed !important; top: 50px; left: 40px; }

这是Safari中的错误吗?有任何想法吗?解决方法?

谢谢!-= b =-

[我仅在Safari(6.1 os x)中看到此问题,当父div设置为position:fixed溢出:隐藏,子div设置为position:fixed,并且它的一部分溢出父级时,就会被剪切...

css safari overflow hidden fixed
2个回答
2
投票

0
投票
.wrapper{ background-color: red; padding: 40px; width: 200px; height: 400px; position: fixed; top: 0; left: 0; } .wrap2{ background-color: yellow; overflow: hidden; position: absolute; top: 0; left: 0; bottom: 0; right: 0; } .inner{ background-color: silver; padding: 20px; width: 400px; height: 200px; position: fixed !important; top: 50px; left: 40px; }

和一个JS小提琴:https://jsfiddle.net/jxmallett/gsyb326v/1/

© www.soinside.com 2019 - 2024. All rights reserved.