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 8 of 8
  1. #1
    New Coder
    Join Date
    Nov 2006
    Posts
    42
    Thanks
    0
    Thanked 0 Times in 0 Posts

    ie6 width problem

    Hello, first of all, this is the problem page: http://mrdantownsend.110mb.com/ [may not work when you try to connect, hosting service is a little buggy now]

    my probelm is that for some reason, the navigation and body divs are three pixels less than what I want them to be, but this renders correctly in IE7+, firefox, and opera, and was wondering how I could fix this.

    thanks much

    mrdantownsend

    here's the css:

    Code:
    *                                  {margin:0px;
                                        padding:0px;
                                       }
    
    body                               {/* background */
                                        background-color:#ffffff;
                                        text-align:center;
                                        margin-left:auto;
                                        margin-right:auto;
                                       }
    
    div#wrapper                        {text-align:center;
                                        margin-left:auto;
                                        margin-right:auto;
                                        width:760px;
                                        /* background */
                                        background-image:url('images/shadow.jpg');
                                        background-position:center;
                                        background-repeat:repeat-y;
                                       }
    
    div#head                           {height:224px;
                                        /* background */
                                        background-color:#ffffff;
                                        background-image:url('images/head.jpg');
                                        background-repeat:no-repeat;
                                        background-position:center;
                                        /* margins */
                                        /* borders */
                                       }
    
    div#nav                            {
                                        width:694px;
                                        /* background */
                                        background-color:#deebff;
                                        /* margins */
                                        padding-top:10px;
                                        /* borders */
                                        border-style:solid;
                                        border-width:3px;
                                        border-color:#000000;
                                        border-bottom-width:0px;
                                        border-top-width:0px;
                                        margin-left:auto;
                                        margin-right:auto;
                                       }
    
    div#body                           {
                                        width:694px;
                                        height:auto;
                                        /* background */
                                        background-color:#deebff;
                                        margin-left:auto;
                                        margin-right:auto;
                                        /* margins */
                                        /* borders */
                                        border-style:solid;
                                        border-width:3px;
                                        border-color:#000000;
                                        border-top-width:0px;
                                        border-bottom-width:0px;
                                       }
    
    div#footer                         {background-image:url('images/footer.jpg');
                                        background-repeat:no-repeat;
                                        background-position:center;
                                        height:70px;
                                       }
    
    img                                {border-width:0px;
                                        border-style:none;
                                        padding:0px;
                                        margin:0px;
                                       }
    
    /* Text Formatting */
    
    h1, h2, h3, p, ul, blockquote      {font-family:georgia, serif;
                                       }
    
    h1                                 {padding-top:12px;
                                        padding-bottom:0px;
                                        font-size:24px;
                                       }
    
    h2                                 {padding-top:0px;
                                        padding-bottom:0px;
                                        text-align:left;
                                        margin-left:47px;
                                        font-size:14px;
                                       }
    
    p                                  {text-align:justify;
                                        font-size:17px;
                                        line-height:1.5;
                                        padding-top:0px;
                                        margin-left:47px;
                                        margin-right:47px;
                                        text-indent:20px;
                                       }
    
    p.intro                            {padding-top:15px;
                                       }
                                       
    ul                                 {padding:6px;
                                        text-align:left;
                                        display:inline;
                                       }
    
    li                                 {list-style:none;
                                        font-weight:bold;
                                        display:inline;
                                        /* padding and margins */
                                        padding-right:10px;
                                        padding-left:10px;
                                       }
    
    p.no                               {text-align:center;
                                        margin-left:auto;
                                        margin-right:auto;
                                        font-size:17px;
                                        line-height:1.0;
                                        padding:0px;
                                        margin:0px;
                                        margin-left:0px;
                                        margin-right:0px;
                                        text-indent:0px;
                                       }
    
    /* Link Formatting */
    
    a                                  {color:#184891;
                                        text-decoration:none;
                                        border-bottom: 2px dotted;
                                       }
    
    a:hover                            {color:#5c9cff;
                                        text-decoration:none;
                                       }
    
    a.pic                              {text-decoration:none;
                                        border-bottom: 0px;
                                        border-style:none;
                                       }
    
    a.nav                              {color:#184891;
                                        text-decoration:none;
                                        border-style:none;
                                       }
    
    a.nav:hover                        {color:#ffffff;
                                        background-color:#72aaff;
                                        text-decoration:none;
                                        border-style:none;
                                       }
    & thats it
    Last edited by mrdantownsend; 12-26-2006 at 01:07 AM.

  • #2
    New Coder
    Join Date
    Nov 2006
    Posts
    42
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Nevermind

    I already figured it out, I used teh <!--[if IE 6]><![endif]--> comment to do it

  • #3
    Senior Coder koyama's Avatar
    Join Date
    Dec 2006
    Location
    Copenhagen, Denmark
    Posts
    1,246
    Thanks
    1
    Thanked 5 Times in 5 Posts
    Yes... this is a patch, but I was wondering why you have
    Code:
    <?xml version="1.0" encoding="utf-8" ?>
    because this is what is causing the problem. It triggers IE6 quirks mode overriding your <!DOCTYPE> triggering of standards mode. In effect, IE6 will render your page according to the IE5 incorrect CSS box model. This is why you have to adjust the div width for IE from 694px to 700px because you have a border of 3px.

    Is there a reason why you have the xml declaration?

  • #4
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    If you resize your browser you can see the header and footer moving when the content stops. To make it stop edit your CSS to read like this:
    Code:
    div#head                           {
                                        height:224px;
                                        width:760px;
                                        margin: 0 auto;
                                        /* background */
                                        background-color:#ffffff;
                                        background-image:url('images/head.jpg');
                                        background-repeat:no-repeat;
                                        background-position:center;
                                        /* margins */
                                        /* borders */
                                       }
    div#wrapper                        {
                                        margin-left:auto;
                                        margin-right:auto;
                                        width:760px;
                                        /* background */
                                        background-image:url('images/shadow.jpg');
                                        background-position:center;
                                        background-repeat:repeat-y;
                                       }
    
    div#footer                         {
                                        width:760px; 
                                        height:70px;
                                        margin: 0 auto;            
                                        background-image:url('images/footer.jpg');
                                        background-repeat:no-repeat;
                                        background-position: center;
                                       }
    And like koyama says, get rid of that xml declaration. There should be nothing in front of the doctype.
    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

  • #5
    New Coder
    Join Date
    Nov 2006
    Posts
    42
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks guys for the <? xml ?> declaration comment,, I thought that if I didn't have it my pages wouldn't validate

    I guess I'm still a n00b at heart

    thanks,

    mrdantownsend

  • #6
    New Coder
    Join Date
    Nov 2006
    Posts
    42
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Excavator View Post
    If you resize your browser you can see the header and footer moving when the content stops. To make it stop edit your CSS to read like this:
    yeah, but I figured if you have the window maximized [which most people do], even on the smallest resolution [800x600], it still shows up right

    but I did what you told me and now it works really smoothly and jsut like you said

    thanks again for the helpful advice:

    mrdantownsend
    Last edited by mrdantownsend; 12-26-2006 at 03:41 PM.

  • #7
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,607
    Thanks
    6
    Thanked 997 Times in 970 Posts
    Quote Originally Posted by mrdantownsend View Post
    yeah, but I figured if you have the window maximized [which most people do] [...]
    How do you know? Can you see it through your screen?
    You can never know what anybody does with their computer or how they have set their viewing preferences. And you can't expect anyone to change their preferences just because you ask them to do so in order to see your website properly.

  • #8
    New Coder
    Join Date
    Nov 2006
    Posts
    42
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by VIPStephan View Post
    How do you know? Can you see it through your screen?
    You can never know what anybody does with their computer or how they have set their viewing preferences. And you can't expect anyone to change their preferences just because you ask them to do so in order to see your website properly.
    yeah, I guess that was a little stupid, but Like I said, that's what I thought, and your advice was very helpful and worked, so now it's fixed and people with micro screens and cascaded windows can see correctly


  •  

    Posting Permissions

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