CSS Float Theory
Mar 07
Conditional Comments

  • Syntax
  •           				<!--[if condition]> HTML <![endif]-->
              			
  • Condition
  •           				<!-- Any Version of IE (typically 5, 5.5, 6, or 7) -->
              				<!--[if IE]> HTML <![endif]-->
              			
              				<!-- Versions Less Than Version -->
              				<!--[if lt IE version]> HTML <![endif]-->
              			
              				<!-- Versions Less Than or Equal To Version -->
              				<!--[if lte IE version]> HTML <![endif]-->
              			
              				<!-- Only Version -->
              				<!--[if IE version]> HTML <![endif]-->
              			
              				<!-- Versions Greater Than or Equal To Version -->
              				<!--[if gte IE version]> HTML <![endif]-->
              			
              				<!-- Versions Greater Than Version -->
              				<!--[if gt IE version]> HTML <![endif]-->
              			
Easy Selectors

  • IE6 and below
  •           				*html .hackname { property: value; }
              			
  • IE7 and below
  •           				*:first-child+html .hackname { property: value; }
              			
              				*html .hackname { property: value; }
              			
  • IE7 only
  •           				*:first-child+html .hackname { property: value; }
              			
  • IE7 and modern browsers only
  •           				html>body .hackname { property: value; }
              			
  • Modern browsers only (not IE7)
  •           				html>/**/body .hackname { property: value; }
              			
  • Opera versions 9 and below
  •           				html:first-child .hackname { property: value; }
              			
  • Firefox 2 only
  •           				.hackname, x:-moz-any-link { property: value; }
              			
  • Firefox 3.0 and newer
  •           				.hackname, x:-moz-any-link, x-default { property: value; }
              			
  • Safari only
  •           				.hackname empty { property: value !important; }
              			
  • Google Chrome and Safari 3.1
  •           				body:first-of-type .hackname { property: value; }
              			
Unrecommended Hacks

  • !important
  •           				.hackname {
              					property: value !important; /* IE7 and Modern Browsers */
              					property: value; /* IE6 and below */
              				}
              			
  • _property: value and -property: value
  •           				.hackname {
              					_property: value; /* IE6 and below */
              				}
              			
  • *property: value
  •           				.hackname {
              					*property: value; /* IE7 and below */
              				}
              			
Related Posts


Leave a Reply

You must be logged in to post a comment.