Export to GitHub

doctype-mirror - AMediaAttribute.wiki


You are here: Home > HTML Reference > Elements > <a> element > media attribute

Usage

<a href="/print.html" media="print">Printer-friendly version</a>

Values

The media attribute must be a valid media query. If not specified, the default value is all.

Elements

You can use the media attribute on the following elements:

  • <a>
  • <area>
  • <link>
  • <source>
  • <style>

Browser compatibility

Compatibility table legend

| Test | IE8 | IE7 | IE6 | FF3 | FF2 | Saf3 | Op9 | Chrome | |:---------|:--------|:--------|:--------|:--------|:--------|:---------|:--------|:-----------| | a.media reflects <a media="all"> | Y | Y | Y | N | N | N | Y | N | | a.media reflects <a media="print"> | Y | Y | Y | N | N | N | Y | N | | a.media reflects <a media="screen"> | Y | Y | Y | N | N | N | Y | N |

Further reading