contents
Documentation Version
Summer '15 (API version 34.0)
Language
English
  • Summer '15 (API version 34.0) 34.0
  • Spring '15 (API version 33.0) 33.0
  • Winter '15 (API version 32.0) 32.0
  • Summer '14 (API version 31.0) 31.0
  • Spring '14 (API version 30.0) 30.0
  • Winter '14 (API version 29.0) 29.0
  • English
  • Japanese

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

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

The example above renders the following HTML:

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

Zip Resource Example

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

The example above renders the following HTML:

<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