Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

link tag media attribute - projection, tv not valid

According to the w3.org validator:

<link rel="stylesheet" href="css/style.css" media="screen, projection, tv" />   

does not seem to be valid anymore due to the projection value.

I don't remember exactly, but this way Opera in Fullscreen is included. Probably Opera will load the file with media="screen" too.

Why is this invalid now? Is there another way to give extra CSS to "fullscreen / projection" devices?

like image 309
Type-Style Avatar asked Jul 14 '15 15:07

Type-Style


People also ask

What is media attribute in link tag?

The media attribute specifies what media/device the target resource is optimized for. This attribute is mostly used with CSS style sheets to specify different styles for different media types. The media attribute can accept several values.

What is the valid media type for @media?

The 'tv' media type, for example, is a multimodal media type that renders both visually and aurally to a single canvas. @media and @import rules with unknown media types (that are nonetheless valid identifiers) are treated as if the unknown media types are not present.

How do I link media queries in CSS?

The Placement of Media Queries The internal method includes adding the <style> tag to the <head> tag of the HTML file, and creating the media query within the parameters of the <style> tag. The external method involves creating a media query in an external CSS file and linking it to your HTML file via the <link> tag.

How do you link media files in HTML?

To set the URL of media file we use <source> tag. This tag is used to attach multimedia files like audio, video and pictures. The <audio>, <video> and <picture> elements contain the <source> element.


2 Answers

Maintainer of the W3C HTML checker here. About 3 weeks ago, I implemented and pushed to the production W3C HTML checker the change that emits these new errors; this change: https://github.com/validator/validator/commit/66c739a49afd050226a91f2b7f49662e0dcc9a09

I made that change in order to bring the HTML checker in conformance with the current CSS Media Queries spec. As noted in an earlier answer:

[...] MQ4 basically deprecates all the CSS2.1 media types except all, print, screen and speech, citing the use of media feature detection instead, saying:

In addition, the following deprecated media types are defined. Authors must not use these media types; instead, it is recommended that they select appropriate media features that better represent the aspect of the device that they are attempting to style against.

Presumably, the validator is marking the value invalid because it violates the stipulation that "Authors must not use these media types".

like image 175
sideshowbarker Avatar answered Oct 12 '22 23:10

sideshowbarker


The complete error message says:

Bad value screen, projection, tv for attribute media on element link: Deprecated media type projection. For guidance, see the Media Types section in the current Media Queries specification.

... and "the current Media Queries specification" links to Media Queries 4, which is currently in development. MQ4 basically deprecates all the CSS2.1 media types except all, print, screen and speech, citing the use of media feature detection instead, saying:

In addition, the following deprecated media types are defined. Authors must not use these media types; instead, it is recommended that they select appropriate media features that better represent the aspect of the device that they are attempting to style against.

Presumably, the validator is marking the value invalid because it violates the stipulation that "Authors must not use these media types".

like image 43
BoltClock Avatar answered Oct 13 '22 00:10

BoltClock