Margins in IE are different than Firefox

This is a discussion on "Margins in IE are different than Firefox" within the Web Page Design section. This forum, and the thread "Margins in IE are different than Firefox are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Sep 28th, 2007, 14:32
New Member
Join Date: Sep 2007
Location: New Zealand
Age: 17
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Margins in IE are different than Firefox

My personal website I'm having problems with is http://ryakee.freehostia.com/FinalBeta it displays perfectly in Firefox because this is where I tested it. However in Internet Explorer it doesn't display well at all. The latest version has the wrong margins and in other versions of IE the boxes are supposedly not in the correct places. I have cheated in a few places to get a quicker result I fear this may be the problem. http://ryakee.freehostia.com/newdesign.jpg is what I want it to look like. I have read other sites and they suggest another stylesheet but I don't want a new stylesheet for every browser! I Just want my website to look the same in every browser! Any help would be greatly appreciated as I have had this problem in other sites as well and I am aware that it is a common problem but this hasn't helped me in finding answers.
I apologize in advance if this is a bad question or if I waste you time in asking it but I'm desperate to improve.

Thanks Very Much!
Makkato
Reply With Quote

  #2 (permalink)  
Old Sep 28th, 2007, 14:45
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Margins in IE are different than Firefox

The problem is that when declaring the width of a box you need to take into consideration the margins, padding and border that you apply to it.

Some browsers (like IE6) exclude the margins, padding and borders in the total width/height of the box.

Others counts all those in the border. It's called the box model. And there's a hack of course.

The reasoning behind the other stylesheet it's to use for these instances where IE6 differs from the others. They're called conditional comments and you put your IE6 stylesheet in there.

Note that what goes in that stylesheet should only be what IE6 needs to see. So ... things like margins, padding, borders and width you put in your regular stylesheet and in the IE6 ones, you just put the width to override the other one.

hth
Reply With Quote
  #3 (permalink)  
Old Sep 28th, 2007, 14:54
New Member
Join Date: Sep 2007
Location: New Zealand
Age: 17
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Margins in IE are different than Firefox

Thanks for taking time to answer the question. I've read about some of what your saying here http://www.456bereastreet.com/archiv...css_box_model/
for anyone else who is having similar problems. So you would agree that having conditional statements for IE is the solution? I guess I was worried that my code was off.
Anyway thanks for your prompt answer!

Makkato
Reply With Quote
  #4 (permalink)  
Old Sep 28th, 2007, 14:57
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Margins in IE are different than Firefox

Yes ... conditional statements are acceptable ... they aren't great ... I mean ... there shuldn't be any but this is the real world
Reply With Quote
Reply

Thread Tools

Posting 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

Similar Threads
Thread Thread Starter Forum Replies Last Post
CSS Breaking up in Firefox, unnecessary margins in IE tox0tes Web Page Design 7 Jun 28th, 2007 12:09
Margins need fixing notagz1 Starting Out 9 May 28th, 2007 14:03
What's up with margins and padding in IE? Donny Bahama Web Page Design 41 Apr 19th, 2007 10:04
ff margins Dapandyman Web Page Design 10 Feb 12th, 2007 23:03
body margins benbacardi Web Page Design 2 Apr 10th, 2004 14:51


All times are GMT. The time now is 19:02.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43