Diem snippets syndication

explorer css hacks with <!--[if IE ]> ... <![endif]-->

April 1, 2010 by alfonso

If you need IE conditional css loading, you can append a condition to your css file in your view.yml:

default:  
    
  http_metas:  
    content-type: text/html  
  
  stylesheets:  
    - styles  
    - reset  
    - main  
    - markdown  
    - ie6: {condition: IE 6}  
    - ie7: {condition: IE 7}  
    - ie8: {condition: IE 8}  
    - ie:  {condition: IE}  
  
  javascripts:  
    - front  
  
  has_layout:     true  
  layout:         layout  

with these lines in yout view.yml, you get your condicional statements in your <head> section:

<!--[if IE 6]><link rel="stylesheet" type="text/css" media="all" href="/themeHomeplace/css/ie6.css" /><![endif]-->  
  
<!--[if IE 7]><link rel="stylesheet" type="text/css" media="all" href="/themeHomeplace/css/ie7.css" /><![endif]-->  
  
<!--[if IE 8]><link rel="stylesheet" type="text/css" media="all" href="/themeHomeplace/css/ie8.css" /><![endif]-->  
  

Add a comment

Comments

    Fork Diem on GitHub