Two different styles for two different media types (screen and print):
![]()
The media attribute is supported in all major browsers.
The media attribute specifies what media/device the CSS style is optimized for.
This attribute is used to specify that the style is for special devices (like iPhone), speech or print media.
Tip: To define more than one media type per style element, use a comma-separated list (example: <style type="text/css" media="screen,projection">).
| 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 preview mode/printed pages | |
| braille | Braille feedback devices |
| aural | Speech synthesizers |
| all | Suitable for all devices |
HTML <style> tag
| WEB HOSTING |
|---|
| Best Web Hosting |
| PHP MySQL Hosting |
| Best Hosting Coupons |
| UK Reseller Hosting |
| Cloud Hosting |
| Top Web Hosting |
| $3.98 Unlimited Hosting |
| Premium Website Design |
| WEB BUILDING |
|---|
| XML Editor - Free Trial! |
| FREE Website BUILDER |
| Best Website Templates Top CSS Templates |
| CREATE HTML Websites |
| EASY WEBSITE BUILDER |
| W3SCHOOLS EXAMS |
|---|
|
Get Certified in: HTML, CSS, JavaScript, XML, PHP, and ASP |
| W3SCHOOLS BOOKS |
|---|
|
New Books: HTML, CSS JavaScript, and Ajax |
| STATISTICS |
|---|
|
Browser Statistics Browser OS Browser Display |
| SHARE THIS PAGE |
|---|