css1Add my vote for this tag create new tag
, view all tags

CSS Conditionals (Conditional Comments) for Internet Explorer

"Several CSS hacks failing. If you are using IE7 (you are MSDN subscriber or received a copy at the PDC) you may notice major sites breaking due to the use of CSS hacks and the strict doctype. "


http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/overview/ccomment_ovw.asp :

" The browser type can be detected using many different techniques. Most methods of browser detection make use of either server- or client-side script, and each have advantages and disadvantages. This article focuses on conditional comments, which offer an alternative to scripted browser detection. Conditional comments offer certain advantages over scripted browser detection techniques and are also easier to use.

Conditional comments have been available since Microsoft Internet Explorer 5, but their use is not restricted to Internet Explorer. Examples are given that show how conditional comments can be used to customize the content delivered to both uplevel and downlevel browsers. Conditional comments make it easy for developers to write pages that downgrade gracefully in less capable browsers, while making it easy to take advantage of the enhanced features and performance offered by Internet Explorer 5 and later versions."

<!--[if IE 5.0]>
<p>Welcome to Internet Explorer 5.0!</p>

However, I put the following code into my css file:

<!--[if IE 5]>
<SCRIPT LANGUAGE="Javascript">
alert("Congratulations. You are running IE5 or later!");
<P>Thank you for closing the message box.</P>
* It was ignored in the CSS file. Maybe it works from HTML?



-- Contributors: MartinCleaver


-- MartinCleaver - 30 Apr 2006

http://www.positioniseverything.net/articles/multiIE.html has a particularly good way to target Conditional Comments to e.g. IE 5.5

-- MartinCleaver - 18 May 2006

Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r3 - 2006-06-14 - MartinCleaver
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.