Page 1 of 1

IE6 how to make it recognize one code???

Posted: Tue May 05, 2009 1:01 pm
by lebatt
Hi,

I coded a site that has a height of say 3740px with white background.

Works great in IE8, and FF3.

But when looking on IE6 it is messed up and long and i need to do max-height 3150px.

How or what can I put in that will say like if* IE6.0 use max-height code, and how can I make it over-ride the 3740px?

THanks

I cant figure that part out

Here's what I tried.. but still no avail

Code: Select all

 
    <link href="../styles.css" rel="stylesheet" type="text/css" />
        <style type="text/css">
    .centerimages {
    padding-left: 150px;
}
    .con {
    height:3740px;
    
    }
        </style>
        <script type="text/javascript">
<![if IE 6]>
<style type="text/css">
.con {
    max-height: 3250px; 
    }
 
</style>
<![endif]-->
 

Re: IE6 how to make it recognize one code???

Posted: Tue May 05, 2009 1:30 pm
by John Cartwright
IE6 is a non-compliant browser. Take a look at http://perishablepress.com/press/2007/0 ... -explorer/ for workarounds.

Re: IE6 how to make it recognize one code???

Posted: Tue May 05, 2009 3:46 pm
by kaszu
For IE6 'height' css property works like 'min-height' in modern browsers; unless 'overflow: hidden' is set, then it will be cropped.

Re: IE6 how to make it recognize one code???

Posted: Tue May 05, 2009 4:17 pm
by pickle
You can use IE conditional comments to have special CSS that is only interpreted by IE6.

Re: IE6 how to make it recognize one code???

Posted: Wed May 06, 2009 11:29 am
by lebatt
Thanks, I'm making it load a new style sheet with the one property I wanted :) AWESOME :)

Re: IE6 how to make it recognize one code???

Posted: Wed May 06, 2009 11:43 am
by pickle
If you've just got one property, it might be better to just have a <style></style> declaration rather than make a new request for another file.

Re: IE6 how to make it recognize one code???

Posted: Wed May 06, 2009 12:20 pm
by kaszu
If it's only 1 selector, then I would suggest using IE6 specific CSS selector:

Code: Select all

.my_class { /* All browsers */
    min-height: 100px;
}
* html .my_class {  /* Only IE6 and below will understand this */
    height: 100px;
}
Note: if doctype is not set, then IE7 will also understand "* html" hack.

Re: IE6 how to make it recognize one code???

Posted: Wed May 06, 2009 2:22 pm
by lebatt
aah great, i like the last tip, i hate IE, if they could just be as good as firefox.... in my opinion