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 NameAttribute TypeDescriptionRequired?API VersionAccess
idStringAn identifier that allows other components in the page to reference the stylesheet component. 10.0global
valueObjectThe URL to the style sheet file. Note that this can be a reference to a static resource.Yes10.0global

See Also