CSS hack: Difference between revisions

Content deleted Content added
Meitar (talk | contribs)
m Conditional Comments: Minor grammatical/typo fixes.
No edit summary
Line 1:
A '''CSS Filter''' is a coding technique used to hide or show CSS markup depending on the browsers brand and/or version number. Browsers have different interpretations of CSS behavior and different levels of support for the W3C standards. Web developers will implement CSS Filters when attempting to achieve consistent layout appearance in browsers that do not have a consistent CSS behavior.
A '''CSS filter''' is a coding technique that aims to effectively hide or show parts of the [[Cascading style sheets|CSS]] to different [[Web browser|browsers]], either by exploiting CSS-handling quirks or bugs in the browser or by taking advantage of lack of support for parts of the CSS specifications. Using CSS filters, some designers have gone as far as delivering entirely different CSS to certain browsers in order to ensure that designs are rendered as expected. Because very early web browsers either were completely incapable of handling CSS or rendered CSS very poorly, designers today often routinely use CSS filters that completely prevent these ancient browsers from 'seeing' any of the CSS. For example, CSS filters are very often put in place to exclude Netscape 4.xx and Internet Explorer 4, ensuring that only more recent 'v5' browsers 'see' the CSS.
 
Some of these CSS Filters make use of expected tags called Conditional Comments to denote special instructions. Other developers have exploited the rendering flaws of certain browsers when Conditional Comments were not available or were perceived to be a better solution at the time.
 
The practice of exploiting rendering flaws in different browsers is commonly referred to as CSS Hacks. These hacks may provide desired results across all the browsers the developers chooses to support at the time, however, they may not have the same results when new browsers are released.
 
=== Conditional Comments ===
Conditional Comments are supported by Microsoft Internet Explorer (version 5 onwards[http://msdn.microsoft.com/workshop/author/dhtml/overview/ccomment_ovw.asp]). They allow web developers to show or hide [[HTML]] code based on the version of the viewer's browser.