I ran into a bug in IE that I don't know how to fix...
If anybody finds a fix to this I would be very greatful, altough I don't think it will be easy
I am building a page that is made up of a header, two columns and a footer.
The left column is fixed in width at 150px and it's being floated left.
The right column is without a width as it's supposed to grow depending on its child elements.
The whole design is in a container of a fixed amout of size (ex. 650px)
The problem is that when an element in the right column is too large in width (say 800px) it does not stretch to the right but rather is bumped under the left column navigation and then it stretches beyond the 650px limit. This is only happenning in IE. In Firefox it's doing what it's supposed to.
To see this in practice take this line
<table cellspacing="0" cellpadding="2" border="1" width="100">
and change the width of the table to 800px
I wonder if this is solvable?
Please understand that the code I am showing is part of a big solution so the fix needs to be CSS driven. I cannot alter the HTML structure
Making left column positioned absolutely cannot be used as there is a footer (not in my code snippet) that doesn't then clear the left column menu.
The menus in the left will vary from area to area so the clearing of the footer must be based on the height of the menu on that page.
Expand|Select|Wrap|Line Numbers
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
- <head>
- <title>tester</title>
- <style type="text/css">
- #left {
- float:left;
- width:150px;
- background-color:#CCA
- }
- #right {
- margin-left: 155px;
- padding: 0 5px;
- background-color:#CAC
- }
- * html #right {
- margin-left: auto;
- padding-left: 160px;
- }
- body{
- margin: 0;
- padding: 0;
- color: #000;
- background-color : #FFF;
- }
- body, p, li, div, span {
- font-family:Verdana, Arial, Helvetica, sans-serif;
- }
- div.container {
- width: 650px;
- margin-left: auto;
- margin-right: auto;
- border:1px solid black;
- }
- ul.nav {
- border:1px solid #C33;
- }
- ul.nav li {
- list-style:none;
- }
- </style>
- </head>
- <body>
- <br><br><br><br>
- <div class="container">
- <div id="left">
- <ul class="nav">
- <li>Menu 1</li>
- <li>Menu 2</li>
- <li>Menu 3</li>
- </ul>
- </div>
- <div id="right">
- <table cellspacing="0" cellpadding="2" border="1" width="100">
- <tr>
- <td>test</td>
- </tr>
- <tr>
- <td>test</td>
- </tr>
- <tr>
- <td>test</td>
- </tr>
- <tr>
- <td>test</td>
- </tr>
- <tr>
- <td>test</td>
- </tr>
- </table>
- </div>
- </div>
- </body>
- </html>