Jump to content

Recommended Posts

Do people code pages in a special way so that they look correct in internet explorer? I designed a site that looks fine on any other browser but in IE, especialy older versions, the divs are in places they should not be. Obviously if I adjust the pixels so they line up in IE they wil not look right in any other browser...so I wonder what to do?

 

Is it simply a case of telling people to use a better browser?

Link to comment
https://forums.phpfreaks.com/topic/112647-coding-for-internet-explorer/
Share on other sites

when it comes to CSS, i usually code it to look good in FF, and then put in hacks for IE. the most common one I use for IE6 is the !important hack.

 

Example: I want my header to have a padding of 5px in FF, but only 4px in IE

#header {
  padding: 5px !important;
  padding: 4px;
}

 

CSS compliant browsers (aka FF) will honor the !important and make it 5pm. IE will not, and will override the 5px with the 4px listed below it.

I personally prefer conditional comments (http://en.wikipedia.org/wiki/Conditional_comments) to hacks, for the simple reason that they were designed for this situation, whereas hacks are just that - hacking something to make it work. The problem with hacks is that they may not work in the future if something changes, as they weren't designed for that purpose in the first place.

 

The other nice thing about conditional comments is that you can target specific versions of IE, so you can have separate spreadsheets for IE5.5, 6 and 7 (and even 8) if you want.

I personally prefer conditional comments (http://en.wikipedia.org/wiki/Conditional_comments) to hacks, for the simple reason that they were designed for this situation, whereas hacks are just that - hacking something to make it work. The problem with hacks is that they may not work in the future if something changes, as they weren't designed for that purpose in the first place.

 

The other nice thing about conditional comments is that you can target specific versions of IE, so you can have separate spreadsheets for IE5.5, 6 and 7 (and even 8) if you want.

 

Thanks! I actually saw this yesterday and tried it but it seemed to not link to my new spreadsheet for IE7. I added in the link and it just did nothing...do you have a good link? Maybe I did it wrong..

I completely agree with Haku - conditional statements are the way to go.

 

I don't recommend supporting IE6 - IE7 has come out and lazy people will get a reward for their laziness. Furthermore, if it works well in IE7 it should work (to some extent) satisfactorily in IE6

 

Make sure the IE override stylesheets are imported after the original stylesheets. - Just don't go crazy using them. It loses it's purpose if you OVERUSE it.

 

- TheFilmGod

you can't ignore IE6 just yet as it still has about 30% of the market - reasons being those with hooky copies of XP, businesses who didn't upgrade to XP as it was so flawed initially or don't want the expense etc etc.

 

Its not hard to cater for IE6 - and the conditional comments are definitely the method of choice in my book, hacks are VERY messey - all you need to do is use a strict doctype and keep your markup semantic and lean and then get the css right for the 'compliant' boys then look at IE6 and apply those extra rules in an IE6 only style sheet.

 

dead easy.

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.