You are currently using a web browser that does not support HTML 5 with style sheets. Please try the standard HTML 5, XHTML 1 or XHTML 1 Mobile version of this page instead.

Cascading Style Sheets

In addition to providing different styles based on the type of device being used to display a web page, CSS style sheets can provide alternate user-selectable views of the page. For example, an alternative style sheet could be used to show the user what the web page would look like if it was to be printed:

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="/site-template.xsl"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" type="application/xslt+xml" href="/styles/print.xsl" media="print"/>
<link rel="stylesheet" type="application/xslt+xml" href="/styles/handheld.xsl" media="handheld"/>
<link rel="stylesheet" type="application/xslt+xml" href="/styles/screen.xsl" media="screen"/>
<link rel="alternate stylesheet" type="text/css" title="Printer-Friendly" href="/styles/print.css" media="print"/>
<link rel="stylesheet" type="text/css" href="/styles/print.css" media="print"/>
<link rel="stylesheet" type="text/css" href="/styles/handheld.css" media="handheld"/>
<link rel="stylesheet" type="text/css" href="/styles/screen.css" media="screen"/>
<title>Example Only</title>
</head>
<body>
<h1>Sample HTML 5 Web Page with Style Sheets</h1>
<p>This is the content of the page. The appropriate CSS styles will be applied</p>
The styles from the appropriate .css file will be applied to various elements on the page and
the "look and feel" in the templates in the appropriate .xsl file will be wrapped around it.
</p>
</body>
</html>

The user can select one the alternate style sheets from the menu bar of their browser, for example, with the options View, then Page Style and, in this case, Printer-Friendly in Firefox.

Last updated Sunday September 19, 2010


Printer-friendly PDF* format:

HTML 5 Tutorial

You are currently viewing this page in HTML 5 Style Sheet* format (* see Clicklets for more infomation). This document is also available in HTML 5 XML*HTML 5 non-XML*XHTML 1 Style Sheet*XHTML 1*XML* HTML 4* XHTML Mobile* WML Mobile* and printer-friendly PDF* formats. This is accomplished with Single Source Publishing, a content management system that uses templates in XSLT style sheets provided by XML Styles .com to transform the source content for various content delivery channels. There is also RDF* metadata that describes the content of this document.