Skip to main content
HTML Validation

Bad value “X” for attribute “media” on element “link”: unrecognized media “X”.

About This HTML Issue

The media attribute on a <link> element has not been recognized.

This attribute specified what media the linked resource is optimized for. As an example, the following will link a general stylesheet, and a specific one for printing:

<head>
  <link rel="stylesheet" type="text/css" href="general.css">
  <link rel="stylesheet" type="text/css" href="print.css" media="print">
</head>

Valid values for this attribute include:

  • all. Default, used for all media.
  • print. Used for printers and print previews.
  • screen. Used for computer, tablets or smartphone screens.

Learn more:

Last reviewed: October 27, 2022

Was this guide helpful?

Find issues like this automatically

Rocket Validator scans thousands of pages in seconds, detecting HTML issues across your entire site.

Ready to validate your sites?
Start your free trial today.