Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

W3C don't validate Viewport

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" >
like image 931
DIDIx13 Avatar asked Apr 16 '18 14:04

DIDIx13


2 Answers

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.

like image 155
DIDIx13 Avatar answered Oct 11 '22 19:10

DIDIx13


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
like image 20
João Pimentel Ferreira Avatar answered Oct 11 '22 19:10

João Pimentel Ferreira