Curriculum
Course: HTML Basic
Login

Curriculum

HTML Basic

HTML Introduction

0/1

HTML Editors

0/1

HTML Attributes

0/1

HTML Paragraphs

0/1

HTML Formatting

0/1

HTML Comments

0/1

HTML Favicon

0/1

HTML Page Title

0/1

HTML Iframes

0/1

HTML Java Script

0/1

HTML File Paths

0/1

HTML Symbols

0/1
Text lesson

Setting The Viewport

The viewport denotes the portion of a web page that is visible to the user. Its dimensions differ depending on the device, being smaller on a mobile phone compared to a computer screen.

It’s recommended to incorporate the following <meta> element into all your web pages:

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

This provides the browser with directives on managing the page’s dimensions and scaling.

The “width=device-width” segment adjusts the page’s width to match the device’s screen-width, which may vary depending on the device.

The “initial-scale=1.0” segment establishes the initial zoom level when the page is initially loaded by the browser.

Below is an illustration comparing a webpage without the viewport meta tag to the same webpage with the viewport meta tag:

Note: If you are accessing this page using a smartphone or tablet, you can tap on the two links below to observe the distinction.