I'm in favour of adding that conditional comments are 'illegal html'. Here's why: standard html is standard so that it can be rendered in any browser. In particular, it is standard so that it can be rendered in a speaker, reader, announcer or some other non-standard non-browser client.
Conditional comments are a way of hiding html by putting it inside a comment, where other browsers won't see it. That is a USEFULL technique, but it is explicitly contrary to the intention of standard html.
And is explicitly contrary to the intention of usability guidelines which specify the use of 'standard html'.
In a worst case, you could choose to hide your whole page by putting it inside an [if IE] comment. It would still parse in a strict parser, but it would contain no 'accessible' content.
This is why the HTML standard includes those remarks about not putting any content inside a comment tag. The intention of the standard was to specify that a generic browser should be able to see all content.
Obviously, conditional comments are used for styles, (and probably should have been implemented as a style tag). When conditional comments are not used to hide content, they don't break accessibility. Everyone knows this, and no-one abuses this feature.
But conditional comments are set to become much more common with the introduction of IE7, and I think that something needs to be said about appropriate use and why it's not standard. (david)18.104.22.168 02:24, 15 March 2007 (UTC)
Edits for IE7 and Bias
I made several changes to bring this article up-to-date and to remove some bias against Microsoft/Internet Explorer.--Iamdeadfish 23:26, 13 July 2007 (UTC)
CSS filter is not the same as a CSS hack
This article should be renamed, moved, deleted, or its content altered to reflect the correct subject --22.214.171.124 13:25, 29 September 2007 (UTC)Marius
- Marius is right. Wikipedia states: "Hacking refers to the re-configuring or re-programming of a system to function in ways not facilitated by the owner, administrator, or designer" and "A CSS filter or hack is a coding technique used to hide or show CSS markup depending on the browser, version number, or capabilities.". Thus, Conditional comments and Dynamic properties are CSS filters but are not CSS hacks. Juan Pablo de la Torre (talk) 15:26, 21 May 2010 (UTC)
Keep this Resource Alive
I found this page while searching for CSS filtering techniques. I decided to correct some terminology, and edit some grammatical errors. I also added some citations. During the course of my search for CSS filtering resources, I have found several instances of link rot. I think it is important to preserve this page since many web designers/developers can benefit from a resource that will endure.mdwong (talk) 22:21, 2 September 2008 (UTC)
- This link: http://qooxdoo.org/documentation/general/webkit_css_styles refers to the set of Prefix filters and give a rational for their existence. The example code does not seem to be correct, however. R39525 (talk) 22:34, 28 January 2012 (UTC)