HTML Link media attribute


Two different style sheets for two different media types (computer screen and print):
<link rel="stylesheet" type="text/css" href="theme.css" />
<link rel="stylesheet" type="text/css" href="print.css" media="print"/>

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.


<link media="value" />

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 media attribute Reviewed by 1000sourcecodes on 02:24 Rating: 5
Powered by Blogger.