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 Responsive Web Design and Testing Adjust the Profile Page and Header

Sean Flanagan
Sean Flanagan
33,235 Points

Disappearing header text

Hi gents and ladies. In the header section, I've aligned the text to the right as directed, but on my index.html page, the word "Portfolio" has vanished. Does anyone know why please?

Here's my responsive.css code if this helps:

@media screen and (min-width: 480px) {
  /***************************
  Two-column layout
  ***************************/
  #primary {
    width: 50%;
    float: left;  
  }

  #secondary {
    width: 40;
    float: right;
  }

  /***************************
  Page: Portfolio
  ***************************/

  #gallery li {
    width: 28.3333%;
  }

  #gallery li:nth-child(4n) {
    clear: left;
  }

  /***************************
  Page: About
  ***************************/

  .profile-photo {
    float: left;
    margin: 0 5% 80px 0;
  }

}

@media screen and (min-width: 660px) {

  /***************************
  Header
  ***************************/

  nav {
    background: none;
    float: right;
    font-size: 1.125em;
    margin-right: 5%;
    text-align: right;
    width: 45%;
  }

}

Thanks

Sean

Sean Flanagan
Sean Flanagan
33,235 Points

Actually the text is still there, but when I move my mouse pointer, the moment it becomes a pointing hand, the text disappears and it's a bit painful on my eyes.

4 Answers

Scott Moore
Scott Moore
4,050 Points

it sounds like you have margin collapsing issue going on. Have you tried using the clearfix option to see if that corrects it? or it could be you need to clear the floats.

Ilias Loukakis
Ilias Loukakis
20,489 Points

Try adding:

#logo { float: left; max-width: 45%; margin-left: 5%; text-align: left; }

since you only moved the nav to the right and not the logo to the left thats might be the issue, tell me it worked :)

Ilias Loukakis
Ilias Loukakis
20,489 Points

Try adding:

#logo { float: left; max-width: 45%; margin-left: 5%; text-align: left; }

since you only moved the nav to the right and not the logo to the left thats might be the issue, tell me it worked :)

Sean Flanagan
Sean Flanagan
33,235 Points

Hi Ilias. I've changed the max-width to 45% and here's what happened. When I expanded my screen to desktop size, my headings moved to the centre. Presumably that's supposed to happen? I've also changed the background to a different colour so it doesn't hurt my eyes so much. I have epilepsy so I have to be careful. Thanks. :-)

Ilias Loukakis
Ilias Loukakis
20,489 Points

I guess so, I can't really tell you if I dont see the exact code, Im happy you found a good solution for u thou ^^