> -----Original Message-----
> Why are you suggesting in the first place to pollute your
> source with different conditional comments on every single
> page of a site. That seems like to much work and maintenance
> for me. Is that what you do?
Well, the pages of the sites I work on are generated dynamically, using
JSP templates, so for the hundreds of pages there are only about 5
different places where I need to specify what stylesheets are imported,
and it's there that the conditional comments are used to include
IE-specific sheets.
In fact, at runtime the generated page looks on the filesystem and sees
if a stylesheet is present and automatically includes the conditional
comments or not. So I don't even need to maintain the code, just add
and remove sheets.
> <div class="ie6fix"><!-- this class is only needed for
> IE6/Win or earlier -->
>
> All I have to do is pull that line of code out of that
> include when IE6 disappears over the horizon (2020). This is
> the filtering hack I'm now using.
And all I need to do is zap a stylesheet file from the disk and it
disappears from every single page and from the generated code.
Furthermore I don't "pollute my source" with meaningless class names
like "ie6fix", instead relying on IE's normal CSS selectors to find
objects with class names that are meaningful in general.
> /*\*//*/
> @import url("test-ie8.css");
> @import("test-ie.css");
> /**/
> @import test-ie; /* For IE5~7/Win */
You seriously feel the above code is more readable, maintainable, and
logical compared to this:
<link rel="stylesheet" type="text/css" href="/css/style.css">
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="/css/style_ie7.css">
<![endif]-->
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="/css/style_ie.css">
<![endif]-->
It's immediately obvious what the above does, even if you've never seen
a conditional comment before. But unless you know 100% all the bugs and
limitations of the css parser for every version of every browser, your
code is, IMO, illegible. I suppose if you're the only person who ever
looks at your own code this isn't an issue, but considering how many
people on this list are in charge of maintaining both the CSS AND the
HTML, I'd think that conditional comments would get more use, especially
if you're already using an external IE-specific stylesheet.
> I not targeting browsers but filtering the good browsers out
> of disastrous mess and rescuing others from the abyss.
Well, "filtering the good browsers" is the same as "targeting the bad"
:) .
Mark
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/