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

header behaving badly..

https://w.trhou.se/zo3x4iqk0o

Heya,

I have a large image with a face in it which I want to display as the header image. I just want the face in the header and I want it to reach across the full header.

When I position the image as a cover it does it correctly. When I ask the background position to be -12.5em I can see the face.

When I combine the two commands I see the face, the header is the correct height but the width is only half the page.

I don't know why this is this?

Thank you so much :)

1 Answer

I used this for one of my headers and it worked fine:

.main-header {

background: #6e8878 url('../img/longwood-banner.jpg') no-repeat center; background-size: cover; height: 160px;

}

See if that works ;)

heya,

thanks for the suggestion, it didn't quite work on my design but I'll keep trying!