Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Applying Custom Style Sheet to Layouts pages

  Asked By: Katie    Date: May 19    Category: Sharepoint    Views: 3015

I have a custom style sheet file that I've applied to all of the sites
in a single site collection. I also have a custom master page loaded as
a feature on the server. The custom master page does little other than
to incorporate the custom style sheet and to add a custom search box to
the side bar.

The only trouble is that all of the _layouts page use
application.master, rather than the style sheet I specified.

So what is the best practice to incorporate the style sheet into the
site collection, including the _layouts pages? Editing core.css,
application.master, and any pages in the layouts folder on the server
are all no-nos. Is there a supported alternative, or do you have to
violate one of the no-nos in order to do it?



2 Answers Found

Answer #1    Answered By: Gopal Jamakhandi     Answered On: May 19

The only real supported  alternative is to include the custom  style sheet
in a custom theme. Then Apply the theme to the site. _layouts pages  do
pick up things from the custom themes. I don't think you can add  a new
style sheet  this way, but you can put your custom style  definitions in
one of the existing css  files that are part of a theme.

Answer #2    Answered By: Chantal Rosa     Answered On: May 19

One could override the application.master file  to point to a new one
via the usage of an HttpModule. This allows you to add  whatever
style you want to your own application.master w/o touching the old
one. There's a pretty good example of this

Didn't find what you were looking for? Find more on Applying Custom Style Sheet to Layouts pages Or get search suggestion and latest updates.