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 trialMedua Okonta
8,808 PointsResponsive background image
Is there a way I can make a background image responsive? I've tried a number of ways but haven't found a solution.
Is it possible in css or query?
4 Answers
Guil Hernandez
Treehouse TeacherCheck out this Quick Tip I did on full page background images. I also cover it in the CSS Deep Dive on background properties.
Chase Lee
29,275 PointsYou can do it in CSS by using a percentage value for the width
and height
, like this:
img{
width: 35%;
height: 20%;
}
Hope that helps.
Elliott Frazier
Courses Plus Student 9,647 PointsHere's a pen I did testing responsive images http://codepen.io/elliott/pen/eBFyq.
it might help. ;)
Medua Okonta
8,808 PointsThanks for the tips guys!