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?
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.
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.
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.
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.
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
,screen
andspeech
, 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".
The complete error message says:
Bad value
screen, projection, tv
for attributemedia
on elementlink
: Deprecated media typeprojection
. 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".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With