July 21, 201016 yr Hello Ive been coding for over 2 - 3 years now, and with a passion HATE IE, mainly because its compatibility problems, Just when you think your site looks nice and perfect you open it in IE, and its completly F***ed Any tips or suggestions? Now to fix this you would setup another style sheet, no problems there then, BUT what do you code for first? Firefox or IE?
July 21, 201016 yr The usual advice is to code for Firefox first. Safari, Opera and Chrome will usually be OK as they are similar to Firefox. Then look at your page in IE8 (probably OK as it is largely like Firefox) then IE7 then IE6. Find out what changes to styles you need for each IE version. Add in conditional comment(s) in the head section AFTER the main stylesheet link so that only IE processes it/them. <!--[if ie 6]> <style type="text/css"> revised style(s) here </style> <![endif]--> See http://www.wickham43.net/generaladvice.php#conditionalcomments Remember that inline styles (those in the html tag) will take priority over any stylesheet or conditional comment in the head section, so keep them to the absolute minimum. You can use a general cc for all IE versions or target a specific version. <!--[if ie]> <style type="text/css"> revised style(s) here </style> <![endif]--> <!--[if lte ie 7]> <style type="text/css"> revised style(s) here </style> <![endif]--> where lte means less than or equal to
July 21, 201016 yr I agree with Wickham - I would also argue that you should validate as you go along, not at the very end. This will get rid of some of the nasty suprises you get when opening your lovely site in IE7/6. Often, IE is simply unforgiving towards badly nested code, and most things can be fixed in the main stylesheet without a separate one for IE. I try to avoid that as far as possible, but you may have to dig out some selectors from under a lot of dust. I do know well, that sinking feeling of opening IE, and as it loads, you know this will not be good..
Create an account or sign in to comment