ie conditional comments

It doesn't matter if you do all the error checking in the world, or if you have the most beautiful graphics, if your site or application design isn't usable, it's not going to do well. Get input and advice on usability and user interface issues here.

Moderator: General Moderators

Post Reply
rehfeld
Forum Regular
Posts: 741
Joined: Mon Oct 18, 2004 8:14 pm

ie conditional comments

Post by rehfeld »

just wanted to hear some opinions on why people commonly use hacks to
make ie behave, instead of conditional comments

my issue w/ (most, not all) hacks is that they may fail when the next version of ie is released.

to me, conditional comments seem like the most fail safe method of feeding(or restricting) styles to ie. I agree, its not always the easiest and fastest method,
but it always validates, and if used correctly, are very likely not to cause problems in future versions of ie.

now i do realize you cant accomplish everything w/ it that you can w/ hacks, but thats not what im referring to. Sometimes hacks are definately the best route, but at least in my experience, ive found conditional comments are the best choice, most of the time.

edited - ive changed the title and this post. i was using the term "conditional statements", when this is most commonly called conditional comments. sorry for the confusion
Last edited by rehfeld on Sun Nov 28, 2004 1:01 pm, edited 1 time in total.
kettle_drum
DevNet Resident
Posts: 1150
Joined: Sun Jul 20, 2003 9:25 pm
Location: West Yorkshire, England

Post by kettle_drum »

Well when you start to work with designers and your job is just to code you seperate the php from the design markup and so dont have the option to run if statments. So that makes it harder to do as you suggest. Then there is just the feeling that php isnt for marking up and so you leave the design of the page for html/xhtml/css which can cope with different browsers - and keep php for doing the hard work of getting and processing the data. Then there is also the feeling that they are no longer hacks, but requirments for cross-browser development.
rehfeld
Forum Regular
Posts: 741
Joined: Mon Oct 18, 2004 8:14 pm

Post by rehfeld »

sorry, i wasnt very clear i guess.

i meant in the html, nothing to do w/ scripting

Code: Select all

<html>
<head>

<link rel="stylesheet" href="all-browsers.css" type="text/css">

<!--&#1111;if ie 5]>

<link rel="stylesheet" href="ie5.css" type="text/css">

<!&#1111;endif]-->

</head>
User avatar
andre_c
Forum Contributor
Posts: 412
Joined: Sun Feb 29, 2004 6:49 pm
Location: Salt Lake City, Utah

Post by andre_c »

The very first thing that i do is add a doctype. This makes IE behave in Standards-compliance mode, which removes a few important rendering differences between IE and other browsers like firefox. After that, usually the hacks I have to make to deal with ie are minimal.
rehfeld
Forum Regular
Posts: 741
Joined: Mon Oct 18, 2004 8:14 pm

Post by rehfeld »

well yes, i agree using a doctype is important when trying to acheive consitent behavior from browsers,
but what im asking is why do people choose to use hacks over conditional comments?


http://msdn.microsoft.com/library/defau ... nt_ovw.asp
Post Reply