Forum Moderators: not2easy

Message Too Old, No Replies

position: relative; & overflow: hidden;

how?

         

Kings on steeds

11:16 am on Dec 8, 2009 (gmt 0)

10+ Year Member



I have a need to have an element with its overflow set to hidden and its parents overflow set to position: relative; but IE doesn't like this and wont hide the overflow of relative elements. this appears to be a known bug, but what i need is a way around it... please help!

example


div#slider ul { overflow: hidden; }
div#slider ul li { position: relative; }
div#slider ul li p { position: absolute; top: 45px; left: 190px }

(i have a js script that the clone that li element (causing an overflow) and that second li wont hide...?

vincevincevince

2:12 pm on Dec 8, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The absolute element is more usually the problem, rather than the relative one. The only solution I know of is to change your design to not use absolute positioning in that place.

Sometimes you can use margins, even negative ones, to achieve a similar result...

Kings on steeds

9:13 pm on Dec 8, 2009 (gmt 0)

10+ Year Member



yer thanks vince I ended us just using margins...just wanted to avoid this cos its bad code.