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

Change the width of the title background image.

​This is my website. http://hollywoodpress.biz/its-you-zayn-malik/ I would like to change the width of the title background image. I get images from http://placeimg.com/​ this site and every time I update the page, I get different image. But the image size is set to 1000*400. I would like to stretch the image to full width. How can I do that? Please help me. Thanks.

3 Answers

I changed the css as follows:

.gdlr-page-title-wrapper {
    background-size: cover;
    background-image: url('http://placeimg.com/1000/400/tech/sepia');
    background-repeat: no-repeat;
    background-position: center center;
}

The easiest way I know how is to set the CSS properties for the element hosting the image to use these properties:

background-image: url("paper.gif");
background-repeat: no-repeat;

This is usually a div element.

Thank you for your response but it didn't work.

Maybe another rule somewhere in your .css is interfering with this one ? Something that concerns img elements, the header, or even this particular class.

Also, maybe should you aim another class ?

(after checking the website, I must say I don't really see the issue in the way the image is displayed)

I modified my code and it worked. Thank you for your response.