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

How do i create a responsive background image

Hey , i am in the html css track and i learned some stuff so i was trying to put like a background image , and its not responsive, when I minimize it , it doesn't look like responsive for mobile devices , how can i make it responsive?

1 Answer

Hey Elie, I believe that later on there is a whole segment devoted to responsive web design. Also, there is no one way to accomplish your task, and the way I recommend doing it may not be the best solution for your project. Without knowing too much about what you are doing, I would recommend: '''css // makes sure that the IMGis contained in container. background-size:contain; // centers background img in container. background-position:center; '''