|
|
CSS question
|
|
|
|
Mac Elite
Join Date: Mar 2002
Location: Clogland
Status:
Offline
|
|
# 2348 out of a series of 389887
Why would a
margin-top: 54px;
work
and a
margin-left: 54px;
not?
|
|
|
|
|
|
|
|
|
Registered User
Join Date: Apr 2004
Status:
Offline
|
|
Depends. If the element is positioned absolutely, it won't accept margins. If the element is next to another element, the margins will collapse to the value of the greater margin.
It really depends on where/how the element is. Can you post an example?
|
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Mar 2002
Location: Clogland
Status:
Offline
|
|
OK, found it.
I was using <p class="foo">
Changed that to <div class="foo"> and the left margin started listening.
Now why a "p" tag ( in my case ) will listen to a margin-top and not a margin-left I haven't figured out yet.
I'm not even sure if it's a thing I wanted to know, but I do now.
|
|
|
|
|
|
|
|
|
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status:
Offline
|
|
I'm guessing it's another style you have defined somewhere. I just tried both and there was no difference.
|
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Mar 2001
Location: CO
Status:
Offline
|
|
Originally Posted by LiquidGuy
Depends. If the element is positioned absolutely, it won't accept margins. If the element is next to another element, the margins will collapse to the value of the greater margin.
It really depends on where/how the element is. Can you post an example?
As I understand it, it's only the TOP & BOTTOM (not left/right) margins that collapse. CSS only listens to the LARGER of the TOP/BOTT margins. (whereas left/right are additive). [tho that doesn't seem to be what you're seeing happen.]
|
TOMBSTONE: "He's trashed his last preferences"
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Mar 2002
Location: Clogland
Status:
Offline
|
|
Originally Posted by Chuckit
I'm guessing it's another style you have defined somewhere. I just tried both and there was no difference.
Quite possibly ( thats why I added "in my case" ) as I'm tweaking some-one else's template.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Forum Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|