views:

405

answers:

1
+2  Q: 

CSS in sharepoint

I need to apply a CSS to a Sharepoint site (WSS3.0) based on the theme applied to a site. The CSS would be saved at root site in 'Document Library'. How do I apply the CSS programmatically on the page?

Thanks!

+1  A: 

Put in the page layout or master page. E.g.

<SharePointWebControls:CssRegistration ID="CssRegistrationMyCSS" name="<% $SPUrl:~sitecollection/Style Library/~language/Core Styles/myCSS.css %>" runat="server"/>

Programatically changing it requires you to modify the control on page load. Not sure how well it would work though.

Nat
What do you think about Hari's desire to keep it in a document library?
Alex Angas
I assumed that the document library he was talking about was the Style Library. I guess ya could? Though it would give access to mess with it to a lot more people.
Nat