On Jul 21, 2005, at 10:14 AM, Guillaume wrote:
In fact, I was going to ask this to the list: many designers target
Ie with conditional comments without mentioning the version they
would like to filter. What is going to happen, with a global <!--
if IE -->... next version of Ie, that will have a better Css
support will it eat the same Css built for older versions ?
I suspect we'll see a flurry of hack-based heart attacks when IE 7
comes out, for more than just the conditional comment thing.
How and when to hack can be contentious. I won't try to tell people
they are wrong to use certain hacks, but I do want to offer up some
specific examples that are not found in http://css-
discuss.incutio.com/?page=GoodCSSHack
I follow the guide that a good hack must be forward compatible. Hacks
should be freaky scary tools in the toolbox. They are the power saw
after it's plugged in. They are the roller gizmo that lets you easily
slide under a car that would uncaringly crush your skull if it slid
off the jack. Hacks must be used with care. Most people understand
this, but don't think about forward compatibility.
Nearly all hacks on dead browsers are fair game, so long as they are
either never delivered to living or future browsers or will be
ignored by any compliant browser. There are two Win IE techniques
commonly used which do not fit this model:
1. Conditional comments that will not filter out all future IE browsers.
2. * html, which will likely apply to all future IE browsers
(possibly not in a rigid XHTML mode)
This is what I tell my teams:
- To properly use conditional comments, you should target a specific
version or less:
<!--[if lt IE 7]>
<link href="/css/hacks/win_ie.css" rel="stylesheet"
type="text/css" />
<![endif]-->
- To properly use the * html hack... put it in a conditional comment.
Where it's not needed. So don't use it. Seriously think about: would
you rather MS drop support for an html ancestor? Or keep it? I
suspect the web will be hurting either way. So avoid the hurt.
For example, say you use a png as a semi-transparent background, and
you assign it with this css in your main stylesheet:
div.foo { background-image: url(bar.png); }
* html div.foo {
background-image:none;
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader
( src='bar.png', sizingMethod='scale');
}
IE 7 will happily apply the filter instead of the background, which
it would have been happier with and capable of doing. So, instead of
all the benefits of a true background (position, tiling, user
preferences for printing), you get all the headache of a filter (does
this IE version use the same syntax?, will it print? why can't I
click the link above this background?). Or say they drop support for
* html, but still use their old box model when in quirks mode. Say
you use * html, and force IE 6 into quirks mode so it can make use of
your box model hacks. Not an easy clean up.
Of course, the opposite may also be true: IE 7 may have all sorts of
new bugs, so you'll have to revisit all your old sites anyway. Your
evaluation may vary, but I would rather assume IE7 will get more
things right than wrong. Some will tell me that's being unduly
optimistic. :)
--
Ben Curtis : webwright
bivia : a personal web studio
http://www.bivia.com
v: (818) 507-6613
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/