With nested divs I’d like to clip the top and left to center the inner 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>
Having a negative top and left seems to put the inner div over the top and left of the containing div. How do I keep the div nested while clipping the top and left?
Add
overflow:hiddento the parent element of the element with a negativetop.Fiddle: http://jsfiddle.net/VZ3gt/