Skip to Main Content
Essential SharePoint
book

Essential SharePoint

by Jeff Webb
May 2005
Beginner content levelBeginner
336 pages
10h 14m
English
O'Reilly Media, Inc.
Content preview from Essential SharePoint

Applying Style Sheets

SharePoint uses cascading style sheets (.css) to control the fonts and the background and foreground colors used by the sites on the SharePoint server. The default style sheet is OWS.css which is found in C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\60\TEMPLATE\LAYOUTS\1033\STYLES.

Changes to OWS.css affect all SharePoint sites on the server. For example, making the following change turns all of the body text on the server red:

    body {
        font-family: verdana, arial, helvetica, sans-serif;
        background: white;
        color: red;
    }

Sites using themes are also affected by THEME.css found in the .\TEMPLATES\THEMES\* folders. You can edit THEME.css to change the styles applied by a specific theme. For example, the following change to THEME.css in the NewTheme folder changes the page title font color for the theme created in the preceding section:

    .ms-pagetitle{
    color:black;
    font-family:Verdana,Arial,Helvetica,sans-serif;
    font-weight:bold;
    }

Changing styles in a theme doesn't immediately change existing sites based on that theme, because style sheets are cached on the client. If you don't see the changes you've made, force a full refresh of the page by pressing Ctrl+F5.

Identifying the class name of styles that SharePoint uses on a page can be difficult. One way to determine the class name of the items on a page is to change the body element of default.aspx (or any other SharePoint page) to include the following event procedure:

 <body marginwidth="0" marginheight="0" ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

SharePoint User's Guide

SharePoint User's Guide

Infusion Development Corp. (Infusion Development Corporation)
Beginning SharePoint® 2010: Building Business Solutions with SharePoint

Beginning SharePoint® 2010: Building Business Solutions with SharePoint

Amanda Perran, Shane Perran, Jennifer Mason, Laura Rogers

Publisher Resources

ISBN: 0596008805Errata Page