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

Fabio Esposito
PLUS
Fabio Esposito
Courses Plus Student 2,901 Points

When I add the "float: left;" declaration to the ".profile-photo" class in the about page, the header comes down a bit

Hi, index.html and contact.html are showing properly. However, when I write this:

  .profile-photo {
    float: left;

  }

in my responsive.css, the header of the page leaves a white band on top of it rather than filling the whole space up to the top of the browser. If I remove the float: left; declaration, I fix the issue but I no longer have the image floating on the left obviously. I am having troubles hunting this little bug I have. css rules are linked on the about.page in the order suggested in the video and this happens only when the width of the browser is over 480px, so I guess the error must be somewhere below the @media screen and (min-width:480px) part of the css code. Any help?

3 Answers

Have you checked your margin value? What are your display values?

Can you provide your full block of code

Fabio Esposito
Fabio Esposito
Courses Plus Student 2,901 Points

Thanks for the feedback. I found the problem in an unexpected piece of code :)

Fabio Esposito
PLUS
Fabio Esposito
Courses Plus Student 2,901 Points

Thanks David for the answer, after continuing with the review of the code thanks to the wc3 code reviewer I found out I missed a ":" in the declaration of the margin for the h3 tag, which is in the main.css file. How the error propagated that far to about.html only when the viewport size was more than 480px is still a mystery to me. But I am happy I found the problem and solved it.

Thanks again :D

I had this same issue and resolved it in the same way that Fabio Esposito did. I was missing a ":" in the declaration of my h3 selector. h3 is only used in the About page, while the other two pages use only h1 and h2, which is probably why this issue only appeared on the About page.