What is Define meta Viewport in html


The current time is of Mobile Web. That's why the website/blog needs to be mobile-friendly. In which viewport value has an important role. With this, you can make your site responsive to each device. Which your readers will also like. The viewport is defined in this way. 


<!DOCTYPE html>

<html>

<head>

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

</head>

<body>


</body>

</html>


Understand the example

To define the viewport, the name attribute's value in the meta tag is the viewport, and the viewport is defined by the content attribute. In which the width has been set to device-width. So that the device in which our website is opening automatically adjusts itself according to the width of the same. And the initial scale is written as 1.9. This makes the site Zoomable. 

The layout of the webpage is controlled from the viewport of meta. The viewport is used for responsive web pages.

some parts of the meta viewport

width = device-width: - Here the content of the webpages is adjusted on the screen according to the width of the screen.

initial-scale = 1.0: - Here when the browser is first loaded, then the initial scale is set at the initial zoom level.

Post a Comment

0 Comments