From the course: HTML: Metadata in the Head

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Setting the viewport

Setting the viewport - HTML Tutorial

From the course: HTML: Metadata in the Head

Start my 1-month free trial

Setting the viewport

- [Instructor] If you've previously done work with responsive design, it's likely you already know about the meta viewport tag. But there's more you can learn. By default, VS Code includes this tag for us automatically when we set up a new web page. It's right here on line number five, it says meta name of viewport. And then it has this content attribute, which has two values with it, a width of a device-width, and an initial scale of 1.0. And you've probably been told in responsive design that this controls the size and the scaling of your web page. And so your webpage will behave responsibly. And so if you were to take a look at this webpage inside of your web browser, and we were to scrunch it down, for example, when we hit our breakpoints, surprisingly, the layout of the web page would change. So this is sort of tablet-ish type size screen and then this would be a phone sort of size screen. And here we've got all of…

Contents