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

background image and navigation

https://w.trhou.se/d72yzluwvb

This is my snap short.. I'm having to set my background image to cover my first layout but it shows only some part of an image. and I'm trying to set main nav to horizontal and without underline. Thank you

1 Answer

Hi Bee To make your header background image fit change background-size:cover and add "center" to your background, as per below:

.main-header {
  padding-top: 10px;
  padding-bottom: 20px;
  height: 550%;
  width: 100%;
  background: url("../img/flower.jpg") center no-repeat;
  background-size:cover;
}

To make your nav horizontal and without an underline just add this to your CSS file:

.main-nav li {
  display:inline-block;
}
.main-nav li a {
  text-decoration: none;
}