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

Matthew Keys
Matthew Keys
1,922 Points

h2 is too close to h1

I cannot get my h2 to look like it does on the video.

'''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: 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%; }

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

h1 { font-size: 2.5em; }

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

}

1 Answer

Hello, I see that you have a margin bottom on your h2, but not on your h1. Adding the same margin-bottom of 20px to your h1 would separate them more. You could also add margin-top: 20px; to your h2 instead, it doesn't matter where you put it in this case.

h1 { 
  font-size: 2.5em; margin-bottom: 20px;
}

h2 { 
  font-size: 0.825em; margin-bottom: 20px; 
}
Nathan Brazil
Nathan Brazil
Courses Plus Student 2,756 Points

Missing the semi colon in the margin bottom for the h1 .

Thanks Nathan! Didn't see that one. It's called a colon though, semi-colon is this one ; :)