---
schema_version: "1"
id: aa914145206176cac54e07502d1896416dead64b8b99d6cd39a7d8af1b5c6bab
title: apex:stylesheet
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/platform/salesforce-pages-developers-guide/guides/pages/components/pages-compref-stylesheet.md
canonical_url: https://developer.salesforce.com/docs/platform/salesforce-pages-developers-guide/guide/pages-compref-stylesheet.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 116abf8054af9b95fd097c4856297a6fcaf2a6858ee4357c26c0b42c8f70b3ab
products:
  - Visualforce Developer Guide
  - Platform Developer Content
---

# 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](https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_html_features_pass_through_attributes.htm) using the "html-" prefix. Pass-through attributes are attached to the generated `<link>` tag.

## Example

```apex
<apex:stylesheet value="/resources/htdocs/css/basic.css"/>
```

The example above renders the following HTML:

```html
<link rel="stylesheet"  type="text/css" href="/resources/htdocs/css/basic.css"/>
```

## Zip Resource Example

```apex
<apex:stylesheet value="{!URLFOR($Resource.StyleZip, 'basic.css')}"/>
```

The example above renders the following HTML:

```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|

**See Also**  


-   [apex:slds](https://developer.salesforce.com/docs/platform/salesforce-pages-developers-guide/guide/pages-compref-slds.md)
-   [Using Custom Styles](https://developer.salesforce.com/docs/platform/salesforce-pages-developers-guide/styling/pages-styling-custom.md)
-   [Extending Salesforce Styles with Stylesheets](https://developer.salesforce.com/docs/platform/salesforce-pages-developers-guide/styling/pages-styling-adding-stylesheets.md)

