Jump to content

CSS max-width columns


karldesign

Recommended Posts

I understand the problem that IE6 and lower does not read the max-width property correctly. That is why I have been using the following code as recommended overwhelmingly online:

 

#div_name{min-width:760px; max-width:955px; width:expression(document.body.clientWidth < 762? "760px" : document.body.clientWidth > 957? "955px" : "auto");}

 

This gives me the max-width functionality in IE6.

 

However, I have come unstuck...

 

If I have two columns, and I would like the right column fixed width 210px and the left column fluid width, the hack no longer works. See the code below:

 

/* css */
#left{margin:0; padding:0; float:left; background:#CCC; max-width:710px; min-width:760px; max-width:955px; width:expression(document.body.clientWidth < 762? "500px" : document.body.clientWidth > 957? "710px" : "auto"); height:250px;}

#right{margin:0 0 0 10px; padding:0 0 0 10px; float:right; width:199px; height:250px; border-left:1px solid #CCC;}

/* html */
<div id="left">content</div><div id="right">content</div>

 

The column does not scale and pushes the fixed column below.

 

Does anyone have a solution to this, and is it because it is nested within another div, using float properties?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.