tags:

views:

349

answers:

2

I have DIV, and UL inside it, with position: absolute. By default left is 0px. I need to move UL to the left on the 100% of UL width. UL right corner would be where DIV left corner begins.

A: 

If you know the width of your ul, set the left property to be -that width, e.g.

left: -100px;
ck
for now i made it with jquery width() -> (margin-left: - ul.width())left and right is not working, cause when absolute, it counts not from box model of DIV, but from screen.
dynback.com
so hcange the position to relative
ck
A: 

Have you tried giving the UL the style:

ul { margin-left:-100%; }

That should move it left the same width as the UL, and will render outside the div. Without more page source, its hard to tell how that will affect the rest of your layout though...

Edit:

To make the UL move relative to the DIV, also set:

div { position:relative; }
rally25rs
margin-left:-100%; its also counts from screen, not that DIV
dynback.com
If you set the DIV to position:relative, then the UL should position itself relative to the DIV. Otherwide, so for javascript or jquery instead.
rally25rs