...

View Full Version : ie6 width problem



mrdantownsend
12-26-2006, 02:01 AM
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:



* {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

mrdantownsend
12-26-2006, 04:48 AM
I already figured it out, I used teh <!--[if IE 6]><![endif]--> comment to do it

koyama
12-26-2006, 04:56 AM
Yes... this is a patch, but I was wondering why you have


<?xml version="1.0" encoding="utf-8" ?>

because this is what is causing the problem. It triggers IE6 quirks mode (http://www.quirksmode.org/css/quirksmode.html) 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?

Excavator
12-26-2006, 06:13 AM
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:


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.

mrdantownsend
12-26-2006, 04:34 PM
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

mrdantownsend
12-26-2006, 04:36 PM
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

VIPStephan
12-26-2006, 04:50 PM
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? :p
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.

mrdantownsend
12-26-2006, 04:51 PM
How do you know? Can you see it through your screen? :p
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 ;)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum