Beginner. I have created a custom template for a CQWP in the ItemStyle.xsl. One thing that I am not sure about is how I could associate a css file so that anytime this template style is used the results are rendered the same way. Is there a good approach to this, or can I even do it?

1 Answer 1


Reference the CSS file in the masterpage being used on the site.

Open your masterpage in SharePoint Designer and add this line in the header tag:

<SharePoint:CssRegistration runat="server" name="path to css file" after="corev4.css" />
  • Agreed. Since the itemStyle.xsl is going to be global to your site, you would want to make the CSS global to your site as well. Include the CSS in your own 'global' custom CSS file, and link to it through your master page(s).
    – user8344
    Jul 5, 2012 at 13:40
  • thanks. This certainly sounds like best practice to me, though I am not able to access master pages in our production system. So if I asked for a hack way to add to item style or another way to get around that, I am guessing the caveats would out weigh the benefit? Thanks for the help!
    – Justin
    Jul 5, 2012 at 13:52
  • Thanks, this really worked great as I was facing the problems in my post is: social.msdn.microsoft.com/Forums/en-US/…
    – user10828
    Sep 20, 2012 at 5:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.