Conditional stylesheets in drupal 6 (IE browsers support)

Internet Explorer implements a proprietary technology called Conditional Comments. Conditional Comments are very useful to fix the broken rendering of CSS in older versions of IE browsers (6 and 7) by placing IE-only CSS inside conditional comments.

Previously in drupal, theme developers had to add these lines specifically to their page.tpl.php template or manually append them to the $styles variable. The Conditional Stylesheets module makes our life easier and allows themes to specify conditional stylesheets in their .info file and the conditional comments will be automatically included at the end of the standard $styles variable.  The following lines of code in the .info file load the ie7.css stylesheet.

; Set the conditional stylesheets that are processed by IE.
conditional-stylesheets[if IE 7][all][] = ie7.css


Posted on April 8, 2010, in Uncategorized. Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: