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 a Website Responsive Web Design and Testing Adjust the Profile Page and Header

How not to wrap text around the image?

I use the technique in the video to style the about page on my site. It's ok when in desktop view, but when I collapse the screen, the text starts to wrap around my avatar, but this is not like in the video when Nick's gravatar is nicely stacked above the text. <br /> Here is the link to my site: http://thietkeweb25.com/en/about/ It would be great if someone help me figure out how to stack the text below the gravatar for mobile screen.

2 Answers

Nick's about page works that way because the margin-bottom prevents the text from appearing bellow his profile image. Perhaps you could divide the content area into two columns

<div class='post-entry'>
    <img src='#'>
    <div>
        <h3>About</h3>
        <p> . . . </p>
        <p> . . . </p>
    </div>
</div>

and use display:table-cell.

.post-entry img {
    border-radius: 100%;
    display: table-cell;
    margin: 0px 3%;
    float: left;
}
.post-entry > div {
    display: table-cell;
}
@media screen and (max-width:400px) {
    .post-entry img {
        width: 100%;
        display: auto;
    }
}

If you display .post-entry as a table then it seems that you have to define the image's width and height explicitly.

Thanks for answer. Your solution works, I learn a new lesson about display: table-cell, it's not a common display, but in this case it works.

Thanks for answer. Your solution works, I learn a new lesson about display: table-cell, it's not a common display, but in this case it works.