Consider this example:
http://jsfiddle.net/treeface/P8JbW/
HTML:
<div id="test">
<img src="http://ycombinator.com/images/y18.gif" />
</div>
CSS:
#test {
position:relative;
margin-left:50px;
margin-top:50px;
border:1px solid black;
height:50px;
width:50px;
overflow-x:visible;
overflow-y:hidden;
}
img {
position:absolute;
left:-11px;
}
I’m expecting to see this:

But I’m getting this:

It seems that the overflow-x property is being overridden here. Is that what’s actually happening? Assuming that I have to keep the overflow-y set to hidden, is there a way around this behavior?
overflowis intended to be used with elements that are not absolutely positioned. If you want to handle the clipping of an absolutely positioned element, use theclipcss property. So to clip on the bottom and top of your containing div, but not the left or right, do this:Sample: http://jsfiddle.net/treeface/UJNcf/6/