Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Dec 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    width issues with ie6

    I've recently been trying to fix a couple of my sites that have problems in ie6. I just got into this about a year ago and didn't even know what css was before ie7 came out, so I'm totally lost on IE6 and its many bugs.

    One in particular is its treatment of widths and padding/margins. Below is a couple snippets of code. What's happening is that in Firefox, IE7 and Opera, my vertical menu is lining up perfectly within the space I give it. In IE6, though, it is pushed to the right by about an extra 1 or 2 px.

    Even worse, when I add padding to the left and right on the #nav li a snippet,
    IE 6 expands the entire menu whereas the other browsers simply give the padding I need.

    I'm guessing this is a "newbie" thing so any help you can provide is much appreciated.

    Code:
    #nav {
    	width: 118px
    	padding: 0;
    	margin: 8px 0 8px 0;
    	font-family:Geneva, Arial, Helvetica, sans-serif;
    	background-color: none;
    	color: #333;
    	list-style:none;
    	}
    #nav li a {
    		display: block;
    		padding: 5px 0 5px 0;
    		background-color:#01409e;
    		color: #fff;
    		text-decoration: none;
    		width: 100%;
    		}

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,801
    Thanks
    160
    Thanked 2,216 Times in 2,203 Posts
    Blog Entries
    1
    A link to your page would be more useful!
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    New to the CF scene
    Join Date
    Dec 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Here's a link

    Link to site

    I don't actually have hosting yet, so it's on a different domain.

    Thanks for taking a look.

  • #4
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,667
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Good morning nimaha,
    I don't have anything with IE6 running right now... but it looks like your box model is off. Google box model for plenty of explanations.

    In the example below, I switched from using em to px since the rest of the measurements are in px. I think it's better to stick with one measurement, sure makes the math easier.
    Code:
    #nav-container {
    	float:left;
    	width:120px;
    	margin:0 0 10px 0;
    	}
    #body-container {
    	margin:10px 12px 10px 130px;
    	}
    #nav {
    	width: 110px;
    	margin: 5px;
    	padding: 0;
    	font-family:Geneva, Arial, Helvetica, sans-serif;
    	background-color: none;
    	color: #333;
    	list-style:none;
    	}
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •