How To Set Viewport On A New Website?
How To Set Viewport On A New Website?
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?
-
- Global Moderator
- Posts: 136
- Joined: 14 Nov 2023, 04:39
- Location: Brooklyn
Viewport header tag for a responsive website
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">
-
- Editor
- Posts: 177
- Joined: 23 Oct 2023, 10:03
Re: How To Set Viewport On A New Website?
Most HTML editors generate this basic code automatically.
Shortcut To Set Viewport
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.
Note the symbol exclamation (!). VS Code will automatically enter the viewport in the file.