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


making figures and background images responsive with foudnation.

l have created a website in foundation and l have a few figures/images that l am animating with a plugin. whats the easiest way to get the figures/images responsive on so that l don't have to write css for every single device.

also this figures got a background images how can l make this images responsive as well?

1 Answer

Since you're already using Foundation, you probably want to check out their Interchange plugin, which:

uses media queries to dynamically load responsive content that is appropriate for different users' browsers

Sounds like it may be useful for what you're doing.

If that seems like overkill, just use Foundation's Grid system to control the container sizes.

I think in Foundation, images will automatically have a max-width: 100% rule to make them shrink when their container's width is less than the image's actual/natural width.

As for background images, you might want to look at the background-size CSS property, with values of cover or contain. Check out this article on Six Revisions: Responsive Full Background Image Using CSS.