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 to make div background image inside another div to responsive?

I've been struggling with this issue for a while, and just wondered if anyone has any advice!

I'm using Bootstrap 3, basically I want to place images inside the container div, that will resize with the browser window. So how else can I make it responsive? Thank you in advance!

http://codepen.io/thehung1724/full/emZXQK/

<div id="special-dishes-section">
    <div class="container">
        <div class="special-dishes">
        </div>    <!-- end special-dishes -->
    </div>    <!-- end container -->
</div>    <!-- end special-dishes-section -->
#special-dishes-section{
    background: url('../images/special-dishes-bg.jpg') no-repeat center center;
    min-height: 560px;
    padding: 71px 0 65px 0;
    position: relative;
}

.special-dishes{
    background: url('../images/wooden-bg.png') no-repeat center center;
    min-height: 424px;
}

1 Answer

I'de solve this by using the actual image something like this instead... codePen