more margin appearing in IE than FFox

This is a discussion on "more margin appearing in IE than FFox" within the Web Page Design section. This forum, and the thread "more margin appearing in IE than FFox 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 Mar 17th, 2008, 22:14
Junior Member
Join Date: Jun 2007
Location: uk
Age: 23
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
more margin appearing in IE than FFox

Hey

I have basic layout started. but when i apply the margin-left property to one of my divs (its a nested div, which may be the problem?) it works as expected in Mozilla, however in IE (version 6) it adds a little bit more. I cant seem to fix it, its driving me insane.

Any help will be greatly appreciated!

The div im having problems with is called "leftcol".

Heres the XHTML file code:

Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title></title>
<link rel="stylesheet" href="style.css" type="text/css" media="screen" />

</head>

<body>
<div id="container">
<div class="outerbox">
<ul id="navlinks">
<li>Home</li>
<li>About Me</li>
<li>Projects</li>
<li>Contact</li>
</ul>
</div>

<div id="wrapper">
<div id="leftcol">
<p>test sentance
</p>
</div>
<div class="clear"></div>
</div>
<div id="bottombox"></div>
</div>

</body>
</html>
Heres the CSS:
Code: Select all
    *{
    margin: 0;
    padding: 0;}
    
    body{
    margin: 0;
    padding: 0;
    text-align: center;
    font-family:Verdana, Arial, Helvetica, sans-serif;
    background: black url(images/1.jpg);
    font-size: 0.7em;
    }
    
    #container{
    text-align: left;
    margin: 100px auto;
    width: 714px;
    }
    
    .outerbox{
    background: url('images/top.gif') no-repeat;
    width: 714px;
    height: 59px;
    }
    
    #wrapper{
    padding: 0;
    background: transparent url("http://www.webmaster-talk.com/images/middleouter.gif") repeat-y center;
    width: 714px;
    height: auto;
    }
    
    #leftcol{
    width: 260px;
    margin-top: 10px;
    margin-left: 20px;
    float: left;
    background: #0099CC;
    }
    
    #bottombox{
    background: transparent url('images/bottomouter.gif') no-repeat;
    height: 37px;
    width: 714px;
    }
    
    .clear{
    clear: both;
    }

    ul{
    list-style-type: none;
    padding: 30px 0 0 0;
    }
    
    #navlinks li{
    display: inline;
    margin-left: 90px;
    color: #CCFF00;
    font-weight: bold;
    font-size: 1.2em;
    }
thanks again!
Reply With Quote

  #2 (permalink)  
Old Mar 17th, 2008, 22:39
SuperMember

SuperMember
Join Date: Jun 2007
Location: uk
Posts: 459
Thanks: 0
Thanked 0 Times in 0 Posts
Re: more margin appearing in IE than FFox

Try changing margin-left to padding- left in leftcol

Pat
Reply With Quote
  #3 (permalink)  
Old Mar 18th, 2008, 13:56
moojoo's Avatar
Moderator
Join Date: Aug 2005
Location: Texas
Age: 31
Posts: 1,742
Blog Entries: 1
Thanks: 0
Thanked 17 Times in 17 Posts
Send a message via AIM to moojoo Send a message via MSN to moojoo Send a message via Yahoo to moojoo
Re: more margin appearing in IE than FFox

Alternately you can utilize a IE 6 targeted conditional comment and an ie6.css style sheet per say and modify the margins to make it work in IE.

Code: Select all
<!--[if IE 6]>
            <link rel="stylesheet" href="includes/css/ie6.css" media="screen" type="text/css" />
<![endif]-->
Generally the ie specific .css files are small compared to your global.css and doing this can save you lots of headaches such as changing for IE then it breaking in FF, Safari etc..
__________________
The internet is just a fad.
http://www.mevans76.com
Last Blog Entry: Apps every Mac based web dev should consider (Jul 10th, 2008)
Reply With Quote
  #4 (permalink)  
Old Mar 18th, 2008, 14:24
Aso's Avatar
Aso Aso is offline
Chief Moderator

SuperMember
Join Date: Oct 2007
Location: UK
Posts: 1,004
Blog Entries: 2
Thanks: 5
Thanked 23 Times in 20 Posts
Send a message via Skype™ to Aso
Re: more margin appearing in IE than FFox

It's the IE6 Float Bug.

Add
Code: Select all
height: 1%
to any floated <div>'s.
Last Blog Entry: The Google Misconception (Feb 3rd, 2008)
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
Graphics Not Appearing teranceh Web Page Design 5 Sep 24th, 2007 15:00
text appearing outside <div> PLEASE HELP! tobymather Web Page Design 5 Jul 29th, 2007 00:31
ffox ok ie7 not behaving! paulos72 JavaScript Forum 0 Jul 22nd, 2007 14:06
mystery non-appearing image jessixcate Graphics and 3D 1 Apr 14th, 2007 02:48
My URL icon isn't appearing. Waa, waa, waa! timmytots Web Page Design 10 Nov 13th, 2005 23:54


All times are GMT. The time now is 08:26.


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