IE6 how to make it recognize one code???

HTML, CSS and anything else that deals with client side capabilities.

Moderator: General Moderators

Post Reply
lebatt
Forum Newbie
Posts: 9
Joined: Sat May 02, 2009 6:43 pm

IE6 how to make it recognize one code???

Post 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]-->
 
Last edited by Benjamin on Tue May 05, 2009 1:29 pm, edited 1 time in total.
Reason: Added html tags.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

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

Post by John Cartwright »

IE6 is a non-compliant browser. Take a look at http://perishablepress.com/press/2007/0 ... -explorer/ for workarounds.
User avatar
kaszu
Forum Regular
Posts: 749
Joined: Wed Jul 19, 2006 7:29 am

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

Post by kaszu »

For IE6 'height' css property works like 'min-height' in modern browsers; unless 'overflow: hidden' is set, then it will be cropped.
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

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

Post by pickle »

You can use IE conditional comments to have special CSS that is only interpreted by IE6.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
lebatt
Forum Newbie
Posts: 9
Joined: Sat May 02, 2009 6:43 pm

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

Post by lebatt »

Thanks, I'm making it load a new style sheet with the one property I wanted :) AWESOME :)
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

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

Post 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.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
User avatar
kaszu
Forum Regular
Posts: 749
Joined: Wed Jul 19, 2006 7:29 am

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

Post 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.
lebatt
Forum Newbie
Posts: 9
Joined: Sat May 02, 2009 6:43 pm

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

Post by lebatt »

aah great, i like the last tip, i hate IE, if they could just be as good as firefox.... in my opinion
Post Reply