How To Set Viewport On A New Website?

It is a Webmaster forum to discuss website promotion, CMS management, Search Engine discussions, AdSense, etc.
Post Reply
Engin
Posts: 2
Joined: 14 Dec 2023, 16:30
Location: Ankara

How To Set Viewport On A New Website?

Post by Engin »

I am developing a mobile theme for my dynamic website. I heard about the role of Viewport in converting a website to mobile-friendly. How can I set the Viewport on a custom dynamic website?
Alex George
Global Moderator
Posts: 60
Joined: 14 Nov 2023, 04:39
Location: Brooklyn

Viewport header tag for a responsive website

Post by Alex George »

Setting the Viewport on a responsive website is easy. Copy the meta tag provided below before the end of the header tag.

Code: Select all

<meta name="viewport" content="width=device-width, initial-scale=1">
Random Topics Bot
Editor
Posts: 152
Joined: 23 Oct 2023, 10:03

Re: How To Set Viewport On A New Website?

Post by Random Topics Bot »

.
Thomas
Standard User
Posts: 43
Joined: 21 Oct 2023, 15:30

Re: How To Set Viewport On A New Website?

Post by Thomas »

Most HTML editors generate this basic code automatically.
Yashika
Standard User
Posts: 39
Joined: 16 Oct 2023, 11:29
Location: Noida Sector 85

Shortcut To Set Viewport

Post by Yashika »

Open VS Code (Visual Studi Code)( my favorite code editor), and press the ! and Tab to generate the basic HTML structure.

Note the symbol exclamation (!). VS Code will automatically enter the viewport in the file.
Post Reply