Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
Now, one of the great things about mobile web browsers is they have the ability to take a full-size web page and scale them down so that they fit on a very small screen. This gives users the ability to pinch and zoom onto the content in order to read it. The idea behind responsive design is to take that same content and rearrange the layout so that they don't have to pinch and zoom, and the layout actually fits or conforms to the screen size. Now, in order to do this, we need to add a line of HTML code to tell the browsers what to do with the viewport on page load.
So back in our HTML file, let's find the line for our meta tag. At the end of the line, let's hit a return and add in another meta tag. So after meta, let's hit space, type name="". Inside of the quotes, type viewport. After that attribute, let's hit a space and add a second one, called content. So inside here, what we're going to do is set "width=device-width, maximum-scale=1.0, minimum-scale=1.0, initial-scale=1.0." Outside of the attribute, space, forward slash, and end the meta tag.
So this tag is going to target the viewport here and then we're going to set the width of the viewport to whatever the device is and the initial scale, which is on page load. Now, we have a minimum and maximum scale here. These are optional, but they will make sure that on some devices the scale won't change on orientation. So when somebody rotates between portrait and landscape, the scaling won't be modified. So now with our viewport set, next we can start working on some CSS rules for the content.
Get unlimited access to all courses for just $25/month.Become a member
117 Video lessons · 43146 Viewers
119 Video lessons · 54419 Viewers
65 Video lessons · 14633 Viewers
113 Video lessons · 82948 Viewers
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.
Your file was successfully uploaded.