Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > CSS question

CSS question
Thread Tools
skalie
Mac Elite
Join Date: Mar 2002
Location: Clogland
Status: Offline
Reply With Quote
Mar 5, 2006, 02:01 PM
 
# 2348 out of a series of 389887

Why would a

margin-top: 54px;

work

and a

margin-left: 54px;

not?
     
LiquidGuy
Registered User
Join Date: Apr 2004
Status: Offline
Reply With Quote
Mar 5, 2006, 04:36 PM
 
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?
     
skalie  (op)
Mac Elite
Join Date: Mar 2002
Location: Clogland
Status: Offline
Reply With Quote
Mar 5, 2006, 08:18 PM
 
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.
     
Chuckit
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Mar 6, 2006, 05:51 PM
 
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'."
     
Love Calm Quiet
Mac Elite
Join Date: Mar 2001
Location: CO
Status: Offline
Reply With Quote
Mar 7, 2006, 07:37 AM
 
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"
     
skalie  (op)
Mac Elite
Join Date: Mar 2002
Location: Clogland
Status: Offline
Reply With Quote
Mar 7, 2006, 07:48 AM
 
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 Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 12:20 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,