HTML <link> media attribute
HTML <link> tag
Example
Two different style sheets for two different media types (computer screen and
print):
<head>
<link rel="stylesheet" type="text/css" href="theme.css"
/>
<link rel="stylesheet" type="text/css" href="print.css"
media="print"/>
</head> |
Try it yourself!
|
Definition and Usage
The media attribute is used to specify different styles for different media
types.
Browser Support
The media attribute with the value of "screen", "print", and "all" is supported in all major browsers.
Tip: Opera also supports "projection" in full screen mode.
Syntax
Attribute Values
Value |
Description |
screen |
Computer screens (this is default) |
tty |
Teletypes and similar media using a fixed-pitch character
grid |
tv |
Television type devices (low resolution, limited scroll
ability) |
projection |
Projectors |
handheld |
Handheld devices (small screen, limited bandwidth) |
print |
Print preview mode/printed pages |
braille |
Braille feedback devices |
aural |
Speech synthesizers |
all |
Suitable for all devices |
HTML <link> tag
|
|
|