Horje
What is The HTML Viewport in Head

The viewport is the user's visible area of a web page. It varies with the device - it will be smaller on a mobile phone than on a computer screen.

You should include the following <meta> element in all your web pages:

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

This gives the browser instructions on how to control the page's dimensions and scaling.

The width=device-width part sets the width of the page to follow the screen-width of the device (which will vary depending on the device).

The initial-scale=1.0 part sets the initial zoom level when the page is first loaded by the browser.

Here is an example of a web page without the viewport meta tag, and the same web page with the viewport meta tag:


Example

HTML Viewport let your html page will view as per browser in Desktop and Phone
index.html
Example: HTML
<meta name="viewport" content="width=device-width, initial-scale=1.0">






Related Articles
What is HTML - The Head Element HTML - The Head Element
How to create The HTML <head> Element HTML - The Head Element
How to create The HTML <title> Element in <Head> HTML - The Head Element
How to create The HTML <style> Element in <head> HTML - The Head Element
How to create The HTML <link> Element in <head> HTML - The Head Element
How to create The HTML <meta> Element in Head HTML - The Head Element
What is The HTML Viewport in Head HTML - The Head Element
How to use HTML Viewport in Head HTML - The Head Element
How to create The HTML <script> Element in head HTML - The Head Element
How to create The HTML <base> Element in head HTML - The Head Element

Single Articles
ExampleHTML - The Head Element

Read Full:
HTML - The Head Element
Category:
Web Tutorial
Sub Category:
HTML - The Head Element
Uploaded:
1 year ago
Uploaded by:
Admin
Views:
55


Reffered: https://www.w3schools.com/html/html_head.asp

Share on: