No Results
Search Tips:
- Please consider misspellings
- Try different search keywords
Newer Version Available
Customizing the Appearance and HTML Output of Visualforce Pages
Visualforce pages and components output HTML that is sent to the browser for
rendering. Visualforce’s HTML generation is sophisticated, automatically providing
page structure, contents, and styling. Visualforce also provides a number of ways to alter Visualforce’s default HTML, substitute your own or associated additional
resources, such as CSS stylesheets or JavaScript files, with a page.
- You can customize the styling of Visualforce pages, by attaching custom styles to individual components, or by including your own styles or stylesheets on the page. This allows you to customize the look of individual elements on the page.
- You can alter the “doctype” (document type, or DTD) of Visualforce pages. This is particularly useful if you are working with HTML5, and may also allow you to address browser compatibility issues.
- You can set a specific content type of a Visualforce page to force the browser to treat the output differently. You can use this, for example, to download a CSV file instead of displaying it in the browser window.
- You can attach custom attributes to Visualforce components that “pass through” to the generated HTML. This is useful, for example, for attaching data- attributes to page elements for use with JavaScript frameworks, such as jQuery Mobile and Knockout.js.
- You can relax the automatic “tidying” of the HTML generated by Visualforce pages, to make it easier to create HTML5 applications.
- You can manually override the generation of <html> and <body> tags in your pages, in favor of static HTML tags you add yourself.