Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Is there a way to apply a different CSS file to system pages in a SharePoint 2010 site collection? We don't want to modify the master page and weren't sure if there's any other solution. Thanks.

Update: We're using a custom page layout for our publishing pages; within this, we have some CSS files that contain custom classes but also overwrite existing SP classes. We have not touched the master page so it's using the default one that came with SharePoint.

share|improve this question
    
It depends on how your CSS is built. Does it overwrite existing standard SP css classes? Do you use a custom masterpage for non-system pages? Please provide us with more info on this. –  Daniel Ziga Dec 6 '11 at 10:01
    
Hi, @Dandroid. Please see update above. –  Alex C Dec 6 '11 at 11:33
add comment

3 Answers

up vote 2 down vote accepted

You could create a SharePoint DelegateControl as described here https://littletalk.wordpress.com/2010/11/18/create-an-additionalpagehead-control-packed-into-a-feature-in-visual-studio-2010/ and check in your code if it runs on a page which contain "/_layouts/" in the url and if so add a reference to your custom CSS file.

share|improve this answer
add comment

A solution is to create a custom masterpage, in which you register all CSS classes needed. This way, you'll be able to use the custom masterpage on your non-system pages and the v4.master (or whatever you're using) on your system pages without having to bug with alternating css.

I personally always go with this as it garuanties me full control.

share|improve this answer
add comment

You could use the alternate css link to brand your system pages, this can be done without any custom code

share|improve this answer
1  
If I remember correctly an alternate CSS link applies to all pages, including system pages. So, I'm not sure how your solution would work out for the original poster of the question. –  Sig Weber Dec 6 '11 at 12:27
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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