media attribute (link, style)
Browser support:Specifies the media types for style definition.
Media types are the target devices for style properties. To set a media type for a style, you can use the @media rule as well.
| JavaScript page for this attribute: media. You can find other example(s) there. |
Possible values:
String that sets a comma-separated list of media types.
The list of the supported media types:
| Default. For all media. | |||||||
| Speech synthesizers. | |||||||
| Braille tactile feedback devices. | |||||||
| Paged braille printers. | |||||||
| Handheld devices. | |||||||
| Printed pages and print preview. | |||||||
| Projectors or print to transparencies. | |||||||
| Color computer screens. | |||||||
| Intended for speech synthesizers. | |||||||
| Teletypes. | |||||||
| Television-type devices. |
Default: all.
Example HTML code 1:
This example illustrates the use of the media attribute:
|
|
||||
<head> <style media="print"> h1 { text-align: center } </style> </head> <body> <h1>This element will be centered in printed pages and print preview.</h1> </body> |
||||
|
||||
|
Did you find this example helpful?
|
Supported by tags:
Related pages:
External links:
User Contributed Comments
