Mark Richards" <[EMAIL PROTECTED]>

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


Good answer. In your case my reply is off target. I did go through all that for 
everyones benefit. Pages can be put together in many different ways and various 
styles can be fed to particular browsers by various method. Conditional 
Comments can be problematic to maintained and some beginners will start adding 
them to every page. Sometimes if it's not a true CCS rendering issue at all but 
just incorrect understanding of CSS or invalid CSS and markup.



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


I guess you need proof. I have now removed that meaningless class name from 
that div. Now let see..., point either IE5 or IE6 at this page (soon to be 
updated).

http://css-class.com/test/bugs/ie/ie-bugs.htm

Now observe how various page elements have now disappeared. The navigation and 
the blue~green strip in the header for instance. Now resize the viewpoint and 
observe my floated element (Honor roll) drop. Should I just stop supporting for 
IE6 now and remove all my other hack for it. When I have finished, there will 
be nothing left. Not quite true some elements will remain. :-)

OK, you can zap a file form here or there and all is fixed but what list is 
this? Does everyone on this list use (I may be mistaken here) PHP? You are 
answering my question with a scripting solution. Will this help a beginner? My 
solutions is entirely based on CSS and markup. Please keep solutions on topic.


> > /*\*//*/
> > @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]-->


Yes I do. I have changed my import slightly.


/*\*//*/
@import url("test-ie8.css");
@import("test-ie.css"); /* IE/Mac */
@import test-ie; /* For IE5~7/Win */


The above code appears on "one" CSS file. I know exactly what it does. First we 
have the beginning of the IE/Mac pass band filter. Both IE/Mac and IE8 see /*/ 
as /**/ so they parse there respective imports. The filter is closed here /* 
IE/Mac */ and IE7 uses the next import. Only the first import is valid.

Anyhow, I was surfing and I have stumbled on to a new IE8 hack. Some list 
member (Thierry!) has discovered that IE8 doesn't need the beginning /*\*/. I 
haven't tested but I could just have.

/*/
@import url("test-ie8.css"); /* IE8 */
@import test-ie; /* For IE5~7/Win */


I find all those linked style sheet redundant. You only need one. Even if you 
had an extra one for IE, why can't you use the star html (* html) or escapes 
within the style sheet to target or filter the difference versions of IE?

Thierry, come on, share what you discovered. :-)


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


And that's why you should comment both your CSS and markup. We know what IE7 
and IE8 does with those comments. OK, your perspective is from several people 
authorizing the code so when answering keep this in mind that there are also 
those single author. The full spectrum.


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


Yes I am targeting. Should I pull those imports out and make those pages look 
awful for IE/Mac, IE7 and IE8. Please tell me how else I can do this without 
conditional comment.


Alan

http://css-class.com/

______________________________________________________________________
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/

Reply via email to