Posted By

rumremix on 10/19/10


Tagged


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

jlaws0n


CSS Conditional Comments in SharePoint 2010


 / Published in: CSS
 

We discovered that conditional comments don’t always work so well in SP2010. Instead, it is necessary to use a SP control. Below is the correct syntax.

  1. Use
  2.  
  3. <SharePoint:CSSRegistration Name="foo.css" ConditionalExpression="gte IE 7" runat="server" />
  4.  
  5. Instead of
  6.  
  7. <!--[if gte IE 7]>
  8. <link rel="stylesheet" type="text/css" href="foo.css"/>
  9. <![endif]-->
  10.  
  11.  
  12. The former will generate the latter when the page is rendered.

Report this snippet  

You need to login to post a comment.