Page 1 of 1

Fixing Leftover Space

Posted: Tue Jul 28, 2009 11:02 am
by jack_indigo
This is probably an easy question for a decent CSS person. I just don't know how to answer it.

Let's say I have 3 DIVs stacked vertically on top of each other on the page from top to bottom. Now let's say I take DIV # 2 and use position relative and move the DIV on top of DIV # 1. The problem is that DIV # 3 doesn't move up to use up the unused space and just leaves a gap.

How do I remove that gap, and remove it cross platform?

Re: Fixing Leftover Space

Posted: Tue Jul 28, 2009 11:25 am
by kaszu
Set margin to DIV#3 too.

Re: Fixing Leftover Space

Posted: Tue Jul 28, 2009 2:06 pm
by jack_indigo
kaszu wrote:Set margin to DIV#3 too.
That kind of sucks. No offense to you -- just kind of upset about CSS. There has got to be a way to make the space that the DIV #2 occupied as null and void since it's been moved.

Re: Fixing Leftover Space

Posted: Tue Jul 28, 2009 2:12 pm
by kaszu
Why do you need DIV#2 before DIV#1 ? Can't you make changes to HTML? If you can't try adding float to those DIVS (sounds silly, but try).

Re: Fixing Leftover Space

Posted: Tue Jul 28, 2009 3:21 pm
by jack_indigo
Someone suggested to me just now to use "margin-bottom" property with a negative value on DIV #2 to make up for the difference used up by the DIV #2 relative positioning. But I have to test this across the platforms to see if it works.