IE Margin Problem (Full Version)

All Forums >> [Web Development] >> Cascading Style Sheets and Accessibility



Message


MCD -> IE Margin Problem (3/24/2009 8:34:24)

In my content area I have the following divs.

#contentWrapper
#leftColumn
#content
#rightColumn

I am using an image to keep the 3 columns even. I want there to be a margin between these 3 columns and the footer. In Firefox I get a margin between the three columns and the footer but not in IE7. Can anyone offer a solution or point me to one? I cannot find the answer doing a Google search. Here is one sample of the CSS.

#outerWrapper #contentWrapper #leftColumn {
background-color: #536747;
float: left;
width: 175px;
color: #ffffff;
padding: 0px 10px 5px 10px;
margin: 0 0 4px 4px;
}

The site has not been uploaded for anyone to view.




Tailslide -> RE: IE Margin Problem (3/24/2009 9:44:30)

Ok - without seeing it's hard to say the easiest solution for you.

in the rule you've posted in your post you don't have commas between the different ids - might just be a typo here and not on your stylesheet but thought I'd mention just in case!

But give the following a try and hopefully one will work! (in no particular order):

1. clear:both on the footer & margin-top on the footer
2. clear:both on the footer and margin-bottom on the #contentWrapper
3. Clear:both on the footer and padding-top on the footer.
4. Use a border with the background colour instead of a margin.

See if any of those help. Otherwise it'll be easiest to stick the page up somewhere - then it'll be much faster to sort.




MCD -> RE: IE Margin Problem (3/24/2009 9:49:54)

Thanks Tail, I'll appreciate the suggestions and work my way through them.




MCD -> RE: IE Margin Problem (3/24/2009 10:33:13)

If I put commas between my ID'S site falls apart. Here is the stylesheet if anyone wants to take a look.



/* Reset the rules.*/
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6 {
margin: 0;
padding: 0;
border: 0;
outline: 0;
font-size: 100%;
}


body {
background-color: #51004c;
line-height: 125%;
font-size: 100%;
color: #000;
font-family: Tahoma, Geneva, sans-serif;
text-align: center;
margin: 0 0 0 0;
padding: 0 0 0 0;
}


h1 {
color: #51004c;
font-size: 120%;
font-weight: bold;
}

h2 {
color: #536747;
font-size: 115%;
font-weight: bold;
}

h3 {
color: #536747;
font-size: 105%;
}

a, a:link { color: #51004c; font-weight:bold; text-decoration: underline;}
a:visited { color: #51004c; font-weight: bold; text-decoration: underline;}
a:hover { color: #fff; font-weight: bold; text-decoration: none; background:#51004c;}
a:active { color: #51004c; font-weight: bold; text-decoration: none;}

#outerWrapper {
background: #fff;
width: 800px;
text-align: left;
margin: 0 auto 0 auto;
}

#contentWrapper {
background: #fff url(../images/green_white1.jpg) repeat-y 50% 0;
clear: both;
}

#outerWrapper #header {
background-color: #ffffff;
padding: 0px 0px 0px 0px;
}

#outerWrapper #topStrip {
background-color: #ffffff;
padding: 0px 0px 0px 0px;
}

/* The left and right columns are slightly smaller than the background image */
#outerWrapper #contentWrapper #leftColumn {
background-color: #536747;
float: left;
width: 175px;
color: #ffffff;
padding: 0px 10px 5px 10px;
margin: 0 0 4px 4px;
clear: both;

}
#outerWrapper #contentWrapper #rightColumn {
background-color: #536747;
float: right;
width: 175px;
color: #ffffff;
padding: 0px 10px 5px 10px;
margin: 0 4px 4px 0;

}

#outerWrapper #contentWrapper #content {
padding: 5px 5px 0px 5px;
margin: 0 210px 4px 210px;
}

#outerWrapper #contentWrapper .clearFloat {
display: block;
}

#outerWrapper #footer {
background-color: #51004c;
padding: 5px 5px 5px 5px;
font-size: 80%;
color: #fff;
margin: 4px 0 0 0;
}




Tailslide -> RE: IE Margin Problem (3/24/2009 12:31:30)

I'll have a look at the files for you - without commas the rule would only be applied to the first ID (FAIK).




MCD -> RE: IE Margin Problem (3/24/2009 12:37:35)

You are right of course. I sure do hate me and tables divorced. [:(]




MCD -> RE: IE Margin Problem (4/7/2009 16:00:08)

I meant to post that putting a border above the footer did correct the problem in IE7. The info may come in handy for someone.




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.0625