Fixing Leftover Space

HTML, CSS and anything else that deals with client side capabilities.

Moderator: General Moderators

Post Reply
jack_indigo
Forum Contributor
Posts: 186
Joined: Sun Jun 08, 2008 11:25 pm

Fixing Leftover Space

Post 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?
User avatar
kaszu
Forum Regular
Posts: 749
Joined: Wed Jul 19, 2006 7:29 am

Re: Fixing Leftover Space

Post by kaszu »

Set margin to DIV#3 too.
jack_indigo
Forum Contributor
Posts: 186
Joined: Sun Jun 08, 2008 11:25 pm

Re: Fixing Leftover Space

Post 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.
User avatar
kaszu
Forum Regular
Posts: 749
Joined: Wed Jul 19, 2006 7:29 am

Re: Fixing Leftover Space

Post 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).
jack_indigo
Forum Contributor
Posts: 186
Joined: Sun Jun 08, 2008 11:25 pm

Re: Fixing Leftover Space

Post 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.
Post Reply