Jump to content

Coding for internet explorer?


Kane250

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
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.

Link to comment
Share on other sites

that hack is for IE6 only...do you have a link to the site so I can check it out? I'm interested in seeing how it is different

 

I sent you a message. I was able to readjust things for IE6, but then when I look thorugh IE7 it's completely messed up again..

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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..

Link to comment
Share on other sites

I don't know any particular tutorials, but I do know that it works. Check to see that you have the right link to the page, and that you have used the correct format and don't have any typos in the code you put in. Put up a link to your site if you have one.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

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.