CSS hack: Difference between revisions

Content deleted Content added
EstherLoer (talk | contribs)
more examples and discussions
EstherLoer (talk | contribs)
Line 8:
Due to quirks in the interpretation of CSS by various browsers, most CSS hacks involve writing invalid CSS rules that are interpreted only by specific browsers, or relying on bugs in specific browsers. An example of this is prefixing rules with an underscore (as in <code>_width</code>) to target Internet Explorer 6—other browsers will ignore the line, allowing it to be used to write code specific to one browser.
 
Similar CSS hacks involve addinginducing syntax errors like asterisks, missing whitespaceswhitespace, and CSS comments around property names. Additionally, in Internet Explorer 6 and 7, the <code>!important</code> declaration canis containrecognized as such with any string after the exclamation mark, e.g. <code>!ie</code>.<ref>{{cite web |title=Browser CSS hacks - |author=Paul Irish |url=https://www.paulirish.com/2009/browser-specific-css-hacks/ |website=www.paulirish.com |access-date=8 June 2022 |date=2009-04-15}}</ref>
 
=== Unsupported CSS ===