No <meta name="viewport"> Tag with Width or Initial-scale
Lighthouse flags the web page when it encounters such a situation:
The following situations encountered as a result of the examination may cause this:
- The
<meta name = "viewport">
tag in the title field of the document, - Viewport meta tag seen with the
content
attribute, - The value that the
content
attribute has should containwidth =
text.
A quick note: If the width is equal to the width of the device, Lighthouse may not include it in the audit. Also, whether it is an initial-scale
key-value
pair or not is not included in the audit by Lighthouse. However, both should be on your website.
How to pass the audit – Adding viewport meta tag
In order to pass through the audit, the viewport <meta>
tag must be added to the <head>
tag of your page. Also, this tag must be supported with the correct key-value pairs. See:
<!DOCTYPE html> <html lang="en"> <head> … <meta name="viewport" content="width=device-width, initial-scale=1"> … </head> …
So why are key-value pair options important?
- Because they ensure that the width of the view area is adjusted according to the device.
- Also, if
initial-scale = 1
, the user will see the initial zoom value when visiting the page.
Test Your Website Performance!
You can quickly analyze your site in a minute