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!

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

Three Column Layout

How can I create a 3 column layout with images that have text below them?

1 Answer

Martin Lecke
Martin Lecke
14,384 Points

There is alot of different ways to do it, but here is one i made for you

<!-- html -->
<div class="wrapper">
    <article>
      <figure>
        <img src="https://achievement-images.teamtreehouse.com/badges_intro_to_html_css_stage-01.png" width="100">
      </figure>
      <figcaption>Text for the first picture</figcaption>
    </article>
    <article>
      <figure>
        <img src="https://achievement-images.teamtreehouse.com/badges_intro_to_html_css_stage-01.png" width="100">
      </figure>
      <figcaption>Text for the first picture</figcaption>
    </article>
    <article>
      <figure>
        <img src="https://achievement-images.teamtreehouse.com/badges_intro_to_html_css_stage-01.png" width="100">
      </figure>
      <figcaption>Text for the first picture</figcaption>
    </article>
</div>
.wrapper {
  background: lightgray;
  padding: 10px;
  display: flex;
  justify-content: space-between;
}

figcaption {
  text-align: center;
}

You can check it out on codepen here