Leave it to Internet Explorer

dpaanlka

macrumors 601
Original poster
Nov 16, 2004
4,868
6
Illinois
Of course my site looks fine in every browser but Internet Explorer, including IE 7.

Now, can anybody tell me why this page is stretched to 100% width in IE, and this one isn't, even though they're generated from the same PHP??? It's supposed to be only 600 pixels wide (to match the top banner).
 

ddekker

macrumors regular
Sep 23, 2006
222
0
Michigan
ie

I'm not on a pc now, but I have heard multiple times that there is a simple line of code that you put at in your page that detects IE7 and loads a little line of css to make things right.. I heard Leo Laporte talk about it on a couple of his podcasts... I would think a little google would fix ya right up.. and be it that IE screws it up and it makes ya mad, you still have to code to it... right or wrong its the majority

DD
 

dpaanlka

macrumors 601
Original poster
Nov 16, 2004
4,868
6
Illinois
well i guess i'll a have to put off solving this problem for now, since dreamhost just now randomly decided my forums don't need to be working at all
 

ThunderLounge

macrumors 6502
Sep 20, 2006
332
0
I'm not on a pc now, but I have heard multiple times that there is a simple line of code that you put at in your page that detects IE7 and loads a little line of css to make things right.. I heard Leo Laporte talk about it on a couple of his podcasts... I would think a little google would fix ya right up.. and be it that IE screws it up and it makes ya mad, you still have to code to it... right or wrong its the majority

DD
Yes. They are called conditional comments.

http://www.quirksmode.org/css/condcom.html


The premise of them, is that every browser except IE sees them as regular html comments.

So, you take lets say... a stylesheet import, and wrap it inside one of the conditional comments.

On the site listed above, there's a list for checking for all kinds of IE versions.

GTE: greater than or equal to
LTE: less than or equal to

etc.

Let's say you need to add a little javascript for IE 5.5+...

Code:
<!--[if gte IE 5.5]>
     stick in your js tag/function for IE 5.5 and up.
<![endif]-->
You can have as many as necessary, wherever necessary.

Need an extra clearing div only in IE? Add it where you need it, and wrap it in a CC.

It's pretty simple to use, and allows your page to still validate as well as your css files too.

No need for star hack, holly hack, or anything of the sort in your css files.

Just take what you would need to hack, and stick it in a new stylesheet like any other class. Just make sure your main stylesheet is called first. ;)

Granted it's still ugly, and it would be nice if IE just freakin worked. But, at least it's somewhat easier to keep track of the tweaks you have to make. :D
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.