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

CSS How to Make a Website Responsive Web Design and Testing Adjust the Profile Page and Header

About.html and Contact.html pages skipped. Footer information skipped. Can we bridge the gap?

In the flow of the HTML course the videos seem to skip the creation of the about.html and contact.html pages as well as some CSS code.

Missing information: How to take the photo of Nick Pettit and crop the photo into the circle shape using CSS. How the logos were resized and positioned. Also, somewhere along the way the gallery photos had sizing CSS applied to them that isn't addressed.

*EDIT* The "Styling Web Pages and Navigation" section closes a lot of the gaps in this question. The logo resize and position and gallery photo sizing and positioning is also addressed.

I expect the circle crop for Nick Pettit's profile photo to be filled in in the following sections.

Suggest Treehouse adds a note about those issues being addressed in future sections for those of us who are following along and don't want our website to display differently than Nick Pettit's website example.

2 Answers

You maybe figured it out, but just in case for other students out there.

In the html file, you can see a class="profile-photo" inside the < img > tag

And in the main.css file, you can see the associated profile-photo class like this :

.profile-photo {
  display: block;
  max-width: 150px;
  margin: 0 auto 30px;
  border-radius: 100%;
}

The file is a 512x512px by itself, so to make it smaller, you simply need to apply a property of max-width: 150px, which limit the maximum picture size to 150px.

The photo/file is not a circle by default, so the other important property here is border-radius: 100%.

It is designed to round each corner of the image, and with a maximum of 100% it will make it an entire circle.

You will have other courses later on the Web Design track with more details specifically about it. This link should help you better understand the border-radius if you need to go further : MDN - border-radius

Now to center the image, there is 2 things :

  1. The margin: 0 auto 30px; is used to automatically adapt the left and right space of the image related to the < section > parent, so it allows us to position it in the center of the section block in a responsive way.

  2. The other one to take in consideration, which is the most important, is the #wrapper id which use the same principle with a margin: 0 auto;

Hope it helps !

Thank you for answering my question and for your interest in the future students who may have this same question.

Niclas Valentiner
Niclas Valentiner
8,947 Points

All of those things are premade to give you some code to work with that doesn't look like plain HTML and resembles an actual site. The pages themselves and all the CSS is seperate since the pages are plain HTML with little value to show being made and the CSS is for a CSS source, not an HTML course.

Just keep going with the course and if you're interested in learning about the CSS you can either go for a CSS course or 2 afterwards or you can go find a suitable track.

I personally quite like this track: http://teamtreehouse.com/tracks/front-end-web-development It covers HTML, CSS, JavaScript, jQuery. Basically everything you'll need to be a competent front end web dev, and it does so very well. In a couple of courses some things are repeated because of similarities between courses but it's not that bad.