CSS Question |
Author: |
Message: |
Eddie
Veteran Member
Posts: 2078 Reputation: 30
32 / /
Joined: Oct 2005
Status: Away
|
O.P. CSS Question
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
...there used to be a signature here
|
|
08-25-2007 11:43 AM |
|
|
Nathan
Veteran Member
Yeah, "large dimensions" ;)
Posts: 2984 Reputation: 76
– / /
Joined: Apr 2005
|
RE: CSS Question
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
This post was edited on 08-25-2007 at 11:59 AM by Nathan.
|
|
08-25-2007 11:58 AM |
|
|
Felu
Veteran Member
Posts: 2223 Reputation: 72
30 / /
Joined: Apr 2006
Status: Away
|
RE: CSS Question
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.
|
|
08-25-2007 11:59 AM |
|
|
Eddie
Veteran Member
Posts: 2078 Reputation: 30
32 / /
Joined: Oct 2005
Status: Away
|
O.P. RE: CSS Question
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
This post was edited on 08-25-2007 at 01:03 PM by Eddie.
...there used to be a signature here
|
|
08-25-2007 12:57 PM |
|
|
Eddie
Veteran Member
Posts: 2078 Reputation: 30
32 / /
Joined: Oct 2005
Status: Away
|
O.P. RE: CSS Question
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.
...there used to be a signature here
|
|
08-25-2007 04:48 PM |
|
|
Baggins
Full Member
B000ALFAZO
Posts: 387 Reputation: 13
30 / /
Joined: Oct 2006
|
RE: CSS Question
Could you elaborate?
I think what you mean is if div1 is longer div2 will stay the same distance away form it.
|
|
08-25-2007 04:52 PM |
|
|
Eddie
Veteran Member
Posts: 2078 Reputation: 30
32 / /
Joined: Oct 2005
Status: Away
|
O.P. RE: CSS Question
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
...there used to be a signature here
|
|
08-25-2007 04:53 PM |
|
|
Baggins
Full Member
B000ALFAZO
Posts: 387 Reputation: 13
30 / /
Joined: Oct 2006
|
RE: CSS Question
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.
|
|
08-25-2007 05:01 PM |
|
|
Eddie
Veteran Member
Posts: 2078 Reputation: 30
32 / /
Joined: Oct 2005
Status: Away
|
O.P. RE: CSS Question
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
...there used to be a signature here
|
|
08-25-2007 07:24 PM |
|
|
hmaster
Senior Member
Posts: 716 Reputation: 24
33 / /
Joined: Nov 2004
|
RE: CSS Question
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?
|
|
08-25-2007 07:48 PM |
|
|
Pages: (2):
« First
[ 1 ]
2
»
Last »
|
|