Thursday, July 15, 2010

WordPress and Conditional Comment CSS

<!--[if condition]>
(what to output if the condition is true) <![endif]-->

Specific Examples


<!--[if IE]>[...]<![endif]-->

If the browser is Internet Explorer (any version)


<!--[if IE 7]>[...]<![endif]-->

If the browser is Internet Explorer 7


<!--[if lt IE 7]>[...]<![endif]-->

If the browser is less than Internet Explorer 7


<!--[if lte IE 7]>[...]<![endif]-->

If the browser is less than, or equal to, Internet Explorer 7


<!--[if gte IE 6]>[...]<![endif]-->

If the browser is greater than, or equal to, Internet Explorer 6


<!--[if gt IE 6]>[...]<![endif]-->

If the browser is greater than Internet Explorer 6


<!--[if IE]>
<link rel="stylesheet" href="<?php bloginfo('template_directory'); ?>/ie.css"
media="screen" type="text/css" />
<![endif]-->

<!--[if lte IE 7]> <link rel="stylesheet"
href="<?php bloginfo('template_directory'); ?>/ie7.css"
media="screen" type="text/css" /><![endif]-->

 


<!--[if lte IE 7]>
<script src="<?php bloginfo('template_directory'); ?>/focus.js"
type="text/javascript"></script><![endif]-->

<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>"
type="text/css" media="screen" /><!--[if IE 7]>
<link rel="stylesheet"
href="<?php bloginfo('template_directory'); ?>/ie7.css" media="screen"
type="text/css" /><![endif]-->

http://wordpress.org/support/topic/417213
http://www.code-styling.de/english/development/wordpress-plugin-page-columnist-en

No comments:

Post a Comment