• Jobs
  • About Us
  • professionals
    • Home
    • Jobs
    • Courses and challenges
  • business
    • Home
    • Post vacancy
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

145
Views
Why viewport meta tag in Chromium is invalid?

I hope my web to be Mobile browser. I already set <meta name="viewport" content=" width=device-width; initial-scale=1.0; maximum-scale=1.0; minimum-scale=1.0; user-scalable=0;"> in my index.html,and it will display normall in Firefox.(width is device width ,not 980px).But I open the web in Mobile chrome,the layout width is 980px ,not device-width. Then I add javascript in html:

 <script>
(function () {
  function
  autoRootFontSize() {
    document.documentElement.style.fontSize = Math.min(screen.width,
    document.documentElement.getBoundingClientRect().width) / 980 * 320 + 'px';
  }
  window.addEventListener('resize', autoRootFontSize)
  autoRootFontSize();
})();

The Mobile Chrome is narmal.Then I have used the commmand 'npm run build' to package my projects and open the web,but viewport width still is 980px.

How to solve this question ?

about 3 years ago · Santiago Gelvez
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Our process Sales
Legal
Terms and conditions Privacy policy
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recommend me some offers
I have an error