Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.

apex:stylesheet

A link to a stylesheet that can be used to style components on the Visualforce page. When specified, this component injects the stylesheet reference into the head element of the generated HTML page.

This component supports HTML pass-through attributes using the "html-" prefix. Pass-through attributes are attached to the generated <link> tag.

Example

1<apex:stylesheet value="/resources/htdocs/css/basic.css"/>

The example above renders the following HTML:

1<link rel="stylesheet"  type="text/css" href="/resources/htdocs/css/basic.css"/>

Zip Resource Example

1<apex:stylesheet value="{!URLFOR($Resource.StyleZip, 'basic.css')}"/>

The example above renders the following HTML:

1<link rel="stylesheet"  type="text/css" href="[generatedId]/basic.css"/>

Attributes

Attribute Name Attribute Type Description Required? API Version Access
id String An identifier that allows other components in the page to reference the stylesheet component. 10.0 global
value Object The URL to the style sheet file. Note that this can be a reference to a static resource. Yes 10.0 global