This rule enforces to use <meta name="viewport" content=".."> in the <head>.


Different browsers and devices may have default viewport settings. Explicitly setting the viewport properties using the <meta name="viewport"> tag ensures a consistent and predictable display across various platforms.

How to use

module.exports = {
  rules: {
    "@html-eslint/require-meta-viewport": "error",

Rule Details

Examples of incorrect code for this rule:


Examples of correct code for this rule:

    <meta name="viewport" content="width=device-width, initial-scale=1" />