W3C don't validate Viewport
Asked Answered
S

2

9

W3C don't validate my viewport meta tag any idea why?

<title>DIDIx13</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" /> 
<!-- Throws a warning "Consider avoiding viewport values that prevent users from resizing documents." -->
<meta name="keywords" content="DIDIx13" >
<meta name="description" content="I'm Darwin and welcome to my website" >
Scrim answered 16/4, 2018 at 14:2 Comment(9)
As the validator says Consider avoiding viewport values that prevent users from resizing documents. But IMHO you want that. People get enerved when on mobile it zooms the website.Creamer
@AjAX. W3schools has a perfect example of viewport and my website should be responsive. Why would a validator so known recommend this?Scrim
Responsive != Ability to zoom. The validator is — not — only so known. It is the validator of the maker of the HTML Protocol. But inventing things does — not — always make you the best user of it.Creamer
W3C !== W3Schools. W3Schools is generally a load of old ####. At least it used to be.Lebensraum
@Lebensraum I know that and it's not useful to my question.Scrim
For me I always want the App feeling without the zoom. No high visitor site uses zoom in viewports.Creamer
That said, recommended is zooming on non-for-mobile-designed sites. You want to have big buttons and all that. Here W3C probably checks if you know what you are doing. Keep in mind.Creamer
Why downvotes? What can I improve?Scrim
@Scrim The W3Schools example is without userscalable=no, hence in line with W3 recommendation. Besides, W3Schools is a great resource for developers, it just has too many cookiesShanan
S
14

TL;DR

Remove "user-scalable=no" and now the validator is fully ok!


I've found out the purpose of "user-scalable=no", thanks to this answer.

Actually "user-scalable=no" prevents the user from zooming. And it allows the browser to gain 300ms per click.

300ms per click? That's pretty damn good! I should let "user-scalable=no"

But this is no longer the case, according to efheng's answer.

<meta name="viewport" content="width=device-width"> is enough to remove 300ms delay.

Scrim answered 16/4, 2018 at 14:49 Comment(0)
S
2

Pay attention that any -scale property also triggers that warning

Therefore you should remove all of the following properties, if existent

  • user-scalable
  • initial-scale
  • maximum-scale
  • minimum-scale
Stere answered 17/1, 2019 at 20:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.