HTML and CSS Reference
In-Depth Information
Attributes
HTML5 Global Attributes
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 in the HTML 4.01 spec is
screen
. In
HTML5, the default is
all
.
scoped
(
scoped="scoped"
in XHTML)
Not in HTML 4.01
. Applies the styles only to the local document tree (i.e., only the des-
cendants of the parent of the
style
element) rather than the whole document.
content type
"
(
text/css
)
Required in HTML 4.01 only
. Specifies the stylesheet language. For Cascading Style
Sheets (currently the only style type option), the value is
text/css
. In HTML5, the
type
attribute is optional if using CSS.
type="
content type
xml:space="preserve"
XHTML only
. Instructs XML processors to preserve the whitespace in the element.
Example (HTML5 and CSS)
<head>
<style>
h1 {color: #666;}
p {line-height: 2;}
</style>
<title>Scientific Presentation</title>
</head>
Example (HTML 4.01 and CSS)
<head>
<style type="text/css">
h1 {color: #666;}
p {line-height: 2;}