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

General Discussion

Bootstrap 3 Carousel

Hi, I am wondering if anyone has had any experience using the carousel in bootstrap 3. I have been having an issue where re-sizing the browser will cause the "carousel-caption" to move outside the image instead of resizing with the background and remaining in the right place.

This only seems to happen when resizing a browser window on one screen and not if the page is loaded on a separate screen (the image is loaded correctly for each screen).

What is the carousel positioning these objects relative to? and how can I make sure that the page is rendered correctly if the browser size changes?

thanks for your help

1 Answer

Have you changed the HTML structure or CSS? The captioning has absolute position, so it's being positioned by bootstrap with in it's parent div, which is the .item div.

They use 20% left and 20% right which should also keep a 20% margin from the text to the edge of the image. Vertical and horizontal is 20px. That should keep everything nice and centered as it scales with pure CSS