Alan Gresley wrote:

> [...] Now having done some test [1], I find that there are IE7 only 
> targeting hacks, Opera only targeting hacks and targeting hacks for 
> both browsers when using the xml prolog.
> 
> *+html - target IE 7 and Opera 9.10 and 9.24
> *~html - target IE 7 and Opera 9.10 and 9.24
> *:first-child+html - target IE 7
> html:first-child - target Opera 9.10 and 9.24
> *+html:first-child - target Opera 9.10 and 9.24
 >
> I will be waiting to see what Georg has to say about this dilemma...

I have known about the potential for targeting Opera with hacks meant
for IE7, for a while, but haven't seen it as a dilemma.

My rather old "targeting stylesheet"[2] contains only one version for
IE7, and that's the one that your test shows _only_ to target IE7 - with
and without the xml declaration. Guess I've been lucky :-)
(I have actually tested that hack continuously, but never changed it.)

Most hacks are unsafe, and using hacks to target new browser versions
are not recommended. Great care has to go into choosing hacks for old
and obsolete versions too, so we don't end up targeting new versions. 
It's a pity we have to use any hacks, but with the sad state
especially IE7 is in it is nearly unavoidable.

I personally only use 'Conditional Comments' for adding HTML elements
that IE/win can't do without. Using 'CC' for stylesheets in not for me.
Consequently: the only reliable hack I know about, and use regularly,
for feeding IE/win extra styles, is the '@import hack'[3]. The resulting
stylesheet will only be seen by browsers based on the Trident engine, so
no chance those styles will end up in good browsers.
Separating IE versions is easy once we're at that level, and I can't
imagine that the '@import hack' will ever backfire. It will hopefully
die one day though, so we can use @import properly.

regards
        Georg

> [1] <http://css-class.com/test/ie7hacktargetingopera.htm>

[2]http://www.gunlaug.no/contents/styles/target-browser.css
[3]http://www.gunlaug.no/contents/wd_additions_12.html
-- 
http://www.gunlaug.no
______________________________________________________________________
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