Html 剪切包含在另一个div中的div的顶部和左侧

Html 剪切包含在另一个div中的div的顶部和左侧,html,css,Html,Css,对于嵌套的div,我想剪辑顶部和左侧以使内部div居中 <div> <div style="position: relative; top: -160px; left: 10px; width: 400px; height: 400px; overflow: hidden;"> <!-- div> <div style="width: 686px; height: 600px; overflow: hidden;" --> <IFRAME S

对于嵌套的div,我想剪辑顶部和左侧以使内部div居中

<div>
<div style="position: relative; top: -160px; left: 10px; width: 400px; height: 400px; overflow: hidden;">
<!-- div>
<div style="width: 686px; height: 600px; overflow: hidden;" -->
<IFRAME SRC="http://www.aol.com/" FRAMEBORDER="0" BORDER="0" ID="slpane" width="900px" height="900px"></iframe> 
</div>
</div>


具有负的顶部和左侧似乎将内部div置于包含div的顶部和左侧。如何在剪裁顶部和左侧的同时保持div嵌套?

更改父元素(具有负填充的元素)上的CSS以包括

overflow: hidden;

overflow:hidden
添加到带有负数
top
的元素的父元素中

小提琴:


<div style="overflow:hidden;">
<div style="position: relative; top: -160px; left: 10px; width: 400px; height: 400px; overflow: hidden;">
<!-- div>
<div style="width: 686px; height: 600px; overflow: hidden;" -->
<IFRAME SRC="http://www.aol.com/" FRAMEBORDER="0" BORDER="0" ID="slpane" width="900px" height="900px"></iframe> 
</div>
</div>