Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML How to Make a Website Styling Web Pages and Navigation Style the Portfolio

How are all the elements of the webpage getting sized as per the browser/device width?

The html files doesn't include a viewport tag, yet the "paragraph text" are getting wrapped up, to fit the width. The css files also lacks a property to resize the elements. Why is "this" line missing

< meta name="viewport" content="width=device-width, initial-scale=1.0">

1 Answer

rydavim
rydavim
18,814 Points

Paragraphs are block-level elements, and will fill the width of their containing element. In this case, your paragraphs are either contained in the link elements with your images, or in the footer element.

<meta name="viewport" content="width=device-width, initial-scale=1.0">

This is a responsive meta tag, designed to let you optimize your website for mobile viewing. Frequently mobile devices will report their width as that of their virtual viewport. This is often a much higher resolution than the physical hardware of the device.

This tag makes it so your website is getting the actual width of the device, allowing you to effectively use things like media queries to improve the look and feel of your website.

Later on you'll add this, once you've started working on your responsive.css file and using media queries. Right now, I wouldn't worry about it too much.

Edit - If you'd like to read more about it, CSS Tricks has a pretty good article on the responsive meta tag.