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


Emil Wallgren
Emil Wallgren
11,737 Points

p breaking out of div, what should I do?

Hi :-)

I'm currently making a website. It contains of a header, container (middle section) and footer.

I'm taking a mobile-first approach. What I'm doing is stacking 4 divs on top of each other. First a div containing a text. Then a div containing a image. Then a div containing a text, and last a div containing an image.

I have specified margins between the divs, but when the size of the browser decreases, the paragraph (in the text-divs) breaks out of the div and hides under the picture (div below). This is not what I want. What should I do to fix this?

Have an amazing day! :-)


2 Answers

Catalin Sucigan
Catalin Sucigan
15,563 Points

Hey, try adding overflows to the text divs