Easy Tutorial
❮ Met Select Remove Prop Style Bordercollapse ❯

Link media Attribute


Definition and Usage

The media attribute sets or returns the device for displaying the document.

For style information, the target medium is crucial. Styles for mobile devices and desktop computers may differ.

Syntax

Setting the media attribute:

Returning the media attribute:

device can be one of the following values:

Value Description
screen For computer screens that do not paginate.
tty For media using a fixed-pitch character grid (such as typewriters, terminals, or devices with limited display capabilities).
tv For TV-type devices.
projection For projectors.
handheld For handheld devices.
print For pages and documents in print preview mode.
braille For braille tactile feedback devices.
aural For speech synthesizers.
all For all devices or apparatuses.

Browser Support

All major browsers support the media attribute.


Example

The following example retrieves the media type using the link element:


❮ Met Select Remove Prop Style Bordercollapse ❯