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
Kohane Kagami
12,390 PointsChange 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
Kohane Kagami
12,390 PointsI 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;
}
Rick Buffington
8,146 PointsThe 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.
Kohane Kagami
12,390 PointsThank you for your response but it didn't work.
Julien riera
14,665 PointsMaybe 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)
Kohane Kagami
12,390 PointsI modified my code and it worked. Thank you for your response.