Shoutbox

CSS Question - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Skype & Technology (/forumdisplay.php?fid=9)
+---- Forum: Tech Talk (/forumdisplay.php?fid=17)
+----- Thread: CSS Question (/showthread.php?tid=77001)

CSS Question by Eddie on 08-25-2007 at 11:43 AM

Ok im calling on you guys for some help yet again please :) On my website for example there are 2 div tags, one above the other, is there a way to keep the distance between div1 and div2 a certain distance no matter how much is in div1 *-)


RE: CSS Question by Nathan on 08-25-2007 at 11:58 AM

Add this to the div1:

code:
margin-bottom: 50px;


or add this to div2:

code:
margin-top: 50px;


Depending if you're using the float attribute. But they should both work
Hope it helps :)
RE: CSS Question by Felu on 08-25-2007 at 11:59 AM

I really can't understand what you're trying to say but what i understand is.

code:
<div id="div1" style="margin-bottom: 10px">...</div>
<div id="div2"></div>

There always would be a distance of 10px between div1 and div2.
RE: CSS Question by Eddie on 08-25-2007 at 12:57 PM

Awesome thanks, yes that is what i wanted, will that always work aslong as the names go in an order of 1,2,3,4??, or do they have to be directly next to eachother in the coding :)

Just realised thats common sense, ty guys :)


RE: CSS Question by Eddie on 08-25-2007 at 04:48 PM

Sorry about this double post but this thread will dissapear otherwise...

How can i get this same method but the div2 is placed depending on when div1 ends.


RE: CSS Question by Baggins on 08-25-2007 at 04:52 PM

Could you elaborate?

I think what you mean is if div1 is longer div2 will stay the same distance away form it.


RE: CSS Question by Eddie on 08-25-2007 at 04:53 PM

quote:
Originally posted by Bilbo
Could you elaborate?

I think what you mean is if div1 is longer div2 will stay the same distance away form it.
Yes(Y)
RE: CSS Question by Baggins on 08-25-2007 at 05:01 PM

It should work like that with what Felu posted, because the margin it measured from the bottom of div1, unless you have other css interfering with the positioning of div2.


RE: CSS Question by Eddie on 08-25-2007 at 07:24 PM

I have other div tags inside of div1 and div2, so i dont know if that effects it, there also "fixed". Doesn't seem to work though :(


RE: CSS Question by hmaster on 08-25-2007 at 07:48 PM

Fixed position means it will stay in the position always so it probably makes the margin tag void if the other content is too long. Have you got it uploaded somewhere so we can see a working example?


RE: CSS Question by Eddie on 08-25-2007 at 07:55 PM

http://www.haboz.net/beta1/beta.php ;) i dont care about IE6 and i want that to be fixed so yeah.