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 > Centering and Margins ignored in Firefox/Safari

Centering and Margins ignored in Firefox/Safari
Thread Tools
Fresh-Faced Recruit
Join Date: Oct 2003
Location: London
Status: Offline
Reply With Quote
Feb 15, 2005, 05:44 AM
 
Hi there

Just getting to grips with CSS/Web Standards....so excuse my code if it's not great.

Could someone please explain to me why, with my site in development, the margins and centering works fine in ie 6 on windows, but using Safari and Firefox this is ignored!?

the link is here

the css is a file called farley.css

http://www.parallaxstudios.co.uk/sta...ley/farley.css

Many thanks
Paul
     
Clinically Insane
Join Date: Nov 1999
Status: Offline
Reply With Quote
Feb 15, 2005, 06:26 AM
 
Always assume that IE/Windows is getting it wrong. There is a very small number of situations in which this assumption will be mistaken, but it will almost always be correct.

Anyway, in your "#sidebar p" rule, you've set the margin to "15" instead of "15px". This looks like a typo, since you've set the other margins in terms of px, but you can only omit the unit (px in this case) when the length is 0, because that's the only length which is the same in all units. Change it to "15px" and your sidebar's centering should be fixed. While you're at it, "line-height" is set to "1.1 em"; remove the space.

You have a similar problem with "#primarycontent h1", where you set margin-left to "37", and in "#primarycontent img" where you set margin-top to "10".

Other than that, I don't see anything off the top of my head, but give those a shot and let us know how it goes.
You are in Soviet Russia. It is dark. Grue is likely to be eaten by YOU!
     
Fresh-Faced Recruit
Join Date: Oct 2003
Location: London
Status: Offline
Reply With Quote
Feb 15, 2005, 07:51 AM
 
Thanks very much. That has sorted out the margins perfectly. A silly mistake I made, that copying and pasting turned into a bigger one!

I still have the problem where I want my fixed width table (2 actually, one on top of the other) to sit horizontally in the centre of the screen. I take you point re IE, but at the moment that is the only browser it works on.

In the markup both tables have align="center" - should I be ditching this and doing something in my body selector in CSS?

I also I have slight alignment issues in the 'Nav' element that don't exist in ie/windows...

Thanks again
Paul
     
Dedicated MacNNer
Join Date: Nov 2004
Location: Stockholm, Sweden
Status: Offline
Reply With Quote
Feb 15, 2005, 09:16 AM
 
ick. IE. i always work to Firefox, then add whatever hacks need to be added for IE6, IE5.5 & IE5.0

it sucks to have to work like that. can't we just kill everyone who uses IE?
     
Grizzled Veteran
Join Date: Jun 2001
Location: Melbourne, Australia
Status: Offline
Reply With Quote
Feb 15, 2005, 09:45 AM
 
Originally posted by Phil Sherry:
it sucks to have to work like that. can't we just kill everyone who uses IE?
But how would we then feel superior if there were no inferior web monkeys to poke fun at? Where'd be the satisfaction in that?
Computer thez nohhh...
     
Dedicated MacNNer
Join Date: Nov 2004
Location: Stockholm, Sweden
Status: Offline
Reply With Quote
Feb 15, 2005, 10:03 AM
 
Originally posted by Simon Mundy:
But how would we then feel superior if there were no inferior web monkeys to poke fun at? Where'd be the satisfaction in that?
you've got a point there, but i'm going to ignore it and push on with my plan to exterminate all IE users!
     
Fresh-Faced Recruit
Join Date: Oct 2003
Location: London
Status: Offline
Reply With Quote
Feb 16, 2005, 03:18 AM
 
Thanks everyone - managed to sort it out and it looks perfect now!
     
   
Thread Tools
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
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 09:09 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2