Name

style — <style> . . . </style>

Inserts stylesheet rules into the head of a document.

Attributes

Internationalization

id="text"

XHTML only. Assigns a unique identifying name to the element.

media="all|aural|braille|handheld|print|projection|screen|tty|tv"

Specifies the intended destination medium for the style information. It may be a single keyword or a comma-separated list. The default is screen.

title="text"

Gives the embedded stylesheet a title.

type="content type" (text/css )

Required . Specifies the stylesheet language. For Cascading Style Sheets (currently the only style type option), the value is text/css.

xml:space="preserve"

XHTML only. Instructs XML processors to preserve the whitespace in the element.

Example

<head>
<style type="text/css">
   h1 {color: #666;}
</style>
<title>Style Sheets</title>
</head>

Get HTML and XHTML Pocket Reference, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.