Why does nav look different in IE?

Discussion in 'HTML & Website Design' started by d0cpaul, Aug 3, 2010.

  1. #1
    d0cpaul, Aug 3, 2010 IP
  2. wierdo

    wierdo Well-Known Member

    Messages:
    1,646
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    140
    #2
    wierdo, Aug 3, 2010 IP
  3. d0cpaul

    d0cpaul Member

    Messages:
    119
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #3
    Originally that's what I did, and it worked for IE but when I looked at FF it looked like crap as you can see in the thumbnails I attached..


    Internet Explorer:
    Internet-Explorer.jpg


    Firefox:
    Firefox.jpg


     
    d0cpaul, Aug 4, 2010 IP
  4. drhowarddrfine

    drhowarddrfine Peon

    Messages:
    5,428
    Likes Received:
    95
    Best Answers:
    7
    Trophy Points:
    0
    #4
    Validate your html and css for those lists of errors.
     
    drhowarddrfine, Aug 4, 2010 IP
  5. wierdo

    wierdo Well-Known Member

    Messages:
    1,646
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    140
    #5
    I found a solution. I've attached the two files I had to modify. I removed the padding, then set the width of each nav item in the HTML file. It appears that setting the width of each nav item did not affect the IE page.
     

    Attached Files:

    wierdo, Aug 4, 2010 IP
  6. d0cpaul

    d0cpaul Member

    Messages:
    119
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #6
    You said you've attached 2 files? When I extracted the file there was only one.. I tried the code but it didn't work maybe it needs the corresponding file that you modified?

     
    d0cpaul, Aug 4, 2010 IP
  7. radiant_luv

    radiant_luv Peon

    Messages:
    1,327
    Likes Received:
    34
    Best Answers:
    1
    Trophy Points:
    0
    #7
    Step 1: First thing first, to test why is this happening just go to your css and change padding to 0 for #qm0
    Now test the page in FF and IE (8); total space taken for all items in FF is less and in IE (8) is more, Because when you assign a width for block and some horizontal padding, in ie those two gets added. think a block of a width 100px and padding in left and right is 10 px, then IE will consider as (left padding+block width+right padding) ie (10px+100px+10px) =120px (IE consider padding right after the edge of the block where as FF consider padding inside the edge of block)

    [Here is a great resource on box model : http://www.quirksmode.org/css/box.html]

    Step 2:
    Now remove the inline style width mentioned for all the base li items.
    for example:

    <li><a style="width: 36px;" href="http://www.loansafe.org/" class="qmparent">HOME</a></li>
    <li><a style="width: 40px;" href="http://www.loansafe.org/forum/" class="qmparent">FORUM</a>
    -
    -
    -
    -
    -
    <li><a style="width: 40px;" href="http://www.loansafe.org/forum/register.php" class="qmparent">JOIN US</a>

    Step 4: Check the page on IE and FF; total space taken by main nav items should be same as FF and IE(8)

    Step 5:
    now in the css, play around with padding for #qm0 a to get the right space between the items

    #qm0 a {
    padding:6px 8px;
    }

    I am unable to attache the test file, I can send to your email though, please pm ur email id. Hope you get this done.
     
    Last edited: Aug 4, 2010
    radiant_luv, Aug 4, 2010 IP
  8. drhowarddrfine

    drhowarddrfine Peon

    Messages:
    5,428
    Likes Received:
    95
    Best Answers:
    7
    Trophy Points:
    0
    #8
    Of course you're paying attention to all these amateurish attempts to fix the unfixable. The W3C validator can't even read your page but you're trying to fix it with padding. Lol!
     
    drhowarddrfine, Aug 5, 2010 IP
  9. bankruptcyonly

    bankruptcyonly Peon

    Messages:
    91
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    check your code.
     
    bankruptcyonly, Aug 5, 2010 IP
  10. wierdo

    wierdo Well-Known Member

    Messages:
    1,646
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    140
    #10
    Sorry about that. I see you got the HTML file, which wouldn't do anything on its own.

    Use the nav menu code from the file I attached. Then, go into http://www.loansafe.org/blog/wp-includes/js/ls-big-nav.css and edit:

    #qm0 a
    {
    padding:5px 20px 5px 8px;

    Change the 20 to an 8. That's what worked for me with the modified widths on the nav items.
     
    wierdo, Aug 5, 2010 IP
  11. CSM

    CSM Active Member

    Messages:
    1,047
    Likes Received:
    25
    Best Answers:
    0
    Trophy Points:
    55
    #11
    Hey there.

    If you really want to make that public... I just can say that this code/style/design is not very good.
    It is even impossible to check that site with validator.w3.org.

    Even your main site is horrible coded and designed. 11 errors with validator.

    Well anyway. You should learn CSS to fix your navbar problems.
    IE is parsing CSS differently.

    You should use conditional comments for IE users and link to an external CSS file for IE only.

    And by the way, to check sites in different browsers you could use browsershots.org ... one of my favourites :)

    Regards,

    Michael
    ---

    Front-End Developer / System Engineer
    Studenten-Vermittlung International S.L.U.

    Umzugshelfer, Nachhilfe und vieles mehr - Studenten-Vermittlung International S.L.U.
     
    CSM, Aug 5, 2010 IP