The Montoya Herald — ChristianMontoya.com
I'm not making this post as an argument against conditional comments, but this is my personal reason for avoiding them. To be honest, I'm afraid of the possibility that someday, the <head> section will be filled with this:
<link rel="stylesheet" href="base-style.css" type="text/css" />
<!--[if IE]>
<link rel="stylesheet" href="ie-style.css" type="text/css" />
<[end if]-->
<!--[if FF]>
<link rel="stylesheet" href="ff-style.css" type="text/css" />
<[end if]-->
<!--[if Opera]>
<link rel="stylesheet" href="opera-style.css" type="text/css" />
<[end if]-->
<!--[if Safari]>
<link rel="stylesheet" href="safari-style.css" type="text/css" />
<[end if]-->
<!--[if Konquerer]>
<link rel="stylesheet" href="konquerer-style.css" type="text/css" />
<[end if]-->
<!--[if iCab]>
<link rel="stylesheet" href="icab-style.css" type="text/css" />
<[end if]-->
<!--[if Flock]>
<link rel="stylesheet" href="flock-style.css" type="text/css" />
<[end if]-->
Conditional comments are just against my idea of how CSS should be served… and that's all I have to say about that.
Well, you actually forgot all the different vesions of IE, that would be much closer to what we'll see in the next months.
Yeah, but that was unnecessary for my example.
I'd think more like
[if IE] style_hacked.css
[else] style.css
Though you are right, it's still a pretty bad direction.
I still getting my feet wet in this web world, but coming from a COBOL cave, even I know there's gotta be a better way! lol
BillyG: See the comments section of "CSS techniques I use all the time" for the reason I posted this entry.
In all honesty I don't see anything like that happening. These conditional comments are significant in that every other browser ignores them as an HTML comment. I don't see any other browser manufacturers adopting the technique any time soon as they already keep Web standards in mind.
Personally I would much rather have all of my Internet Explorer fixes separated from the site style simply for maintenance and longevity. Until IE catches up, you would be forced to re-examine all of your projects upon each significant IE update had you employed hacks throughout the design — not something I would enjoy doing.
Sure, conditional comments add a bit of clutter to your document, but in my opinion it is a much cleaner solution than using hacks. I'm not speaking of hacks in that they are not valid style, because many 'accpted' hacks are. The fact remains that they're hacks, leaving potential for sporadic support in the future.
Conditional comments are ignored by everything but [specific versions of] Internet Explorer. CSS hacks are most often still processed client side. The migration from IE6 to IE7, I would think, would be a big inspiration to start using conditional comments on a regular basis simply because an itemized list of rendering issues were corrected, while many still remain.
In the ideal future, when all browsers employ Web standards in their document rendering, conditional comments will become deprecated, leaving a few lines of commented HTML, as opposed to style sheets littered with correctional styles that will waste bandwidth and interfere with document readability.
I will only use Conditional Comments for one purpose and that is getting my CSS to work in that Internet Explorer. Damn Microsoft.
I do see your point, but I don't think your use of conditional comments would increase the likelihood of the situation above.
All the vendors responsible for the browsers you mention seem committed towards complying with the CSS spec, and bringing their implementations in line as much as possible. As such, it's unlikely that we'd ever need workarounds for each browser.
I find extra stylesheets via conditional comments invaluable for dealing with Internet Explorer 5 and 6, as their bugs are severe, and frequently encountered. There are bugs in other browsers, but they're rare and simple enough for me not to mind simply avoiding that particular bit of CSS.
I share your and Clagnut's views. I find it efficient to group all my "hacks" in one area at the end of the CSS file. For float-clears, for example, it's more optimized anyway to group my selectors instead of declaring them everytime I've floated an element.
The ONLY time I use CC is to pass non-compliant, IE-proprietary CSS to IE only. Example: alpha filters to support PNG backgrounds in IE 5.5 and 6. But then there's the rub: It takes a complicated formula of nested CC just to filter out IE 5 and IE 7.
Can we just take IE out behind the barn and shoot it already?
I've seen others post good ideas for MS: integrate Gecko into a new IE while leaving Trident intact. Use Gecko, Presto or WebKit for any sites that are in standards/strict mode, use Trident for sites missing a DOCTYPE or otherwise in quirks mode. That way, they can have their beloved backward-compatibility for all those sites that don't know what standards are and be able to keep up with the modern world in moving the Web forward (instead of holding it back like it does today).
Cascading Style Sheets (CSS) web design lessons
Css link Properties Attributes - examles
http://css-lessons.ucoz.com/link-css-examples-1.htm
http://css-lessons.ucoz.com/link-css-examples-2.htm