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

Why does the mobile size heading become taller greens than the fuller sized web pages? Margin/padding issue, or other?

From main.css

/*******************************
Heading
*******************************/

header {
  float: left;
  margin: 0 0 30px 0;
  padding: 50px 0 0 0;
  width: 100%;
}

#logo {
  text-align: center;
  margin: -20px;
}

h1  {
  font-family: 'Changa One', sans-serif;
  margin: 15px 0;
  font-size: 1.75em;
  font-weight: normal;
  line-height: 0.8em;
}

h2 {
  font-size: 0.75em;
  margin: -10px 0 0;
  font-weight: normal;
}


responsive.css

@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: PORTFOLIO
  *******************************/

  .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%;
  }

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

  h1 {
    font-size: 2.5em;
  }

  h2 {
    font-size: 0.825em;
    margin-bottom: 20px;
  }

  header {
    border-bottom: 5px solid #599a68;
    margin-bottom: 60px;
  }


}

Maybe its something that isn't here?

What do you mean by "taller greens"? I don't understand the question. Please elaborate.

Also, when you say "heading", do you mean the <h1> - <h6> tags? Or the <header> tag?

Sorry, I mean that the heading doesnt match mobile vs web. So when I pull the screen to and away. The web (wide version) looks good, but the mobile has more green at the top and the spacing between the logo is more than I like and longer than the web version. Does this help?

1 Answer

I'm sure I totally understand your question. However, in your media query you are adding a green margin which may be responsible for the change in color. If you are seeing that the logo image appears taller and narrower in your mobile design vs. your desktop design, it may be due to your margins. Your logo in your media query is only 45% of the width of its parent container. Depending on what that container is and how wide it is, it may be distorting your logo to appear taller and narrower. Without seeing your html and a screen shot, its all a bit unclear though.