You want all of your Visualforce pages to have a consistent look and feel that can easily be updated.
Create a static resource from a Cascading Style Sheet and include it in your Visualforce pages. A static resource is a file or archive that you upload and
then reference in a Visualforce page.
To create a static resource from a stylesheet:
To reference the stylesheet in a page, create the following Visualforce page:
- Click Setup | Develop | Static Resources.
- Click New Static Resource.
- In the Name text box, enter myStyleSheet. This name is used to identify the resource in Visualforce markup.
- In the Description text area, enter My site-wide stylesheet.
- Next to the File text box, click Browse to navigate to a local copy of your stylesheet.
- Click Save.
<!-- Your content goes here -->
This page uses styles from my stylesheet.
The stylesheet is a static resource.
To change the look of your pages,
all you need to do is update the static resource with your new styles,
and every page that uses that static resource displays with your new
Static resources can be used
for many other purposes, not just stylesheets. A static resource can
or any other type of file you want to use in your Visualforce pages.
A static resource name can only contain alphanumeric
characters, must begin with a letter, and must be unique in your organization.
If you reference a static resource in Visualforce markup and then change the name of the resource, the Visualforce markup is updated to reflect that change.
A single static
resource can be up to 5 MB in size, and an organization can have up to 250 MB of static resources, total.