jpw21683
01-22-2008, 08:35 PM
I'm currently in the process of a complete website redesign for my employer. A co-worker created the template in Photoshop, and I went about recreating it in XHTML w/CSS. However, we've come across a few problems as we've added content, and I've been able to fix them all except for this one.
First of all, for our template we wanted a 3-column layout, the left and right columns are fixed-width (in pixels). The center column, where the content goes, expands with the browser width. I tried several examples found on the web, but went with http://www.codeproject.com/KB/HTML/relatively_simple.aspx and made my own edits.
Both the left column (used for submenu items) and the right column (used for various widgets) are floated appropriately. The middle column is placed beneath the other columns in my HTML so it fits between.
However, on some pages I want two columns of info in the center column. I've wrapped each content block in a div, set display to block, appropriate width, and floated the div left/right. After the two divs, I've added an empty paragraph with the clear CSS property set to "both". I then list my next two divs, float them appropriately, rinse & repeat. In Internet Explorer 7, this produces the clean look I planned on.
However, in any other browser, the empty paragraph with "clear: both" clears the content in the left and right columns instead of the content in the center column! This is difficult to explain, so please refer to the following links:
Color-coded screenshot from IE7 (correct layout!): http://www.joshuapweiland.com/evpl/trouble-ie.jpg
Color-coded screenshot from Firefox 2.0 (incorrect!): http://www.joshuapweiland.com/evpl/trouble-ff.jpg
I've also set up a demo page you can preview in your browser to view the source. It's at http://www.joshuapweiland.com/evpl/index.html. Test it in IE and FF and you'll see what I mean. The CSS file is at http://www.joshuapweiland.com/evpl/css/main.v3.css.
I'd greatly appreciate any help I can get! I'm assuming that IE is actually at fault, but it's displaying it as I intended!!!
Thanks in advance,
Josh
First of all, for our template we wanted a 3-column layout, the left and right columns are fixed-width (in pixels). The center column, where the content goes, expands with the browser width. I tried several examples found on the web, but went with http://www.codeproject.com/KB/HTML/relatively_simple.aspx and made my own edits.
Both the left column (used for submenu items) and the right column (used for various widgets) are floated appropriately. The middle column is placed beneath the other columns in my HTML so it fits between.
However, on some pages I want two columns of info in the center column. I've wrapped each content block in a div, set display to block, appropriate width, and floated the div left/right. After the two divs, I've added an empty paragraph with the clear CSS property set to "both". I then list my next two divs, float them appropriately, rinse & repeat. In Internet Explorer 7, this produces the clean look I planned on.
However, in any other browser, the empty paragraph with "clear: both" clears the content in the left and right columns instead of the content in the center column! This is difficult to explain, so please refer to the following links:
Color-coded screenshot from IE7 (correct layout!): http://www.joshuapweiland.com/evpl/trouble-ie.jpg
Color-coded screenshot from Firefox 2.0 (incorrect!): http://www.joshuapweiland.com/evpl/trouble-ff.jpg
I've also set up a demo page you can preview in your browser to view the source. It's at http://www.joshuapweiland.com/evpl/index.html. Test it in IE and FF and you'll see what I mean. The CSS file is at http://www.joshuapweiland.com/evpl/css/main.v3.css.
I'd greatly appreciate any help I can get! I'm assuming that IE is actually at fault, but it's displaying it as I intended!!!
Thanks in advance,
Josh