This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 13039 - "media only screen" flagged as error
Summary: "media only screen" flagged as error
Status: RESOLVED FIXED
Alias: None
Product: CSSValidator
Classification: Unclassified
Component: CSS 3 (show other bugs)
Version: CSS Validator
Hardware: PC Windows XP
: P2 normal
Target Milestone: ---
Assignee: This bug has no owner yet - up for the taking
QA Contact: qa-dev tracking
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-24 06:56 UTC by Owen Leibman
Modified: 2011-10-31 13:30 UTC (History)
0 users

See Also:


Attachments

Description Owen Leibman 2011-06-24 06:56:08 UTC
A lot of pages suggest the following as a media query for smartphones:
@media only screen and (max-device-width: 480px) { ...
This is flagged with the error message "unrecognized media only".

Aside from its widespread use, I see that the W3C candidate recommendation for media queries
http://www.w3.org/TR/css3-mediaqueries/
explicitly allows such a construction (see Example IX, prefaced by the comment: "The keyword only can also be used to hide style sheets from older user agents. User agents must process media queries starting with only as if the only keyword was not present.")

So it sounds like this message is being issued erroneously. For the record, I selected CSS3 level 3 as the profile.
Comment 1 Yves Lafon 2011-10-31 13:30:48 UTC
Fixed, the support for media-queries has been redone form scratch, as a result it solved this bug.
See http://qa-dev.w3.org:8001/css-validator/