Forum Moderators: not2easy

Message Too Old, No Replies

Relative Positioning, but element still takes up its natural space

         

Jeremy_H

5:46 pm on Jan 26, 2006 (gmt 0)

10+ Year Member



I'm trying to have an element be positioned relative to where it should be, so I'm using position:relative.

Its landing where I want it to, but the thing is, its still taking up space in its natural spot, bumping down elements below.

How can I make it so the things below it in the code position themselves as if they didn't realize the first element was there?

Thanks

jetboy

6:08 pm on Jan 26, 2006 (gmt 0)

10+ Year Member



. Put an absolutely positioned element inside the relative one, and position that. The relatively positioned one will create a new zero point for positioning, but collapse to take up no space.

. Use negative margins. margin-right: -100%; for example. *Check this carefully* on your supported browsers if you choose to go down this route. I've only used it in limited scenarios.

Jeremy_H

6:16 pm on Jan 26, 2006 (gmt 0)

10+ Year Member



Thanks so much!

Unfortunately I can't nestle the elements or else I would break valid html rules, but the negative margins worked great.

I've tested it in PF IE 6 and PC FF 1, now I guess I just need to do some more testing to make sure it works in the rest of the browsers before implementing it.

Thanks again, I was heading in the right directions attempting z-indexs and different floats. I would never have ventured into negative margins.