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 would I get the image captions to display to the left or right of the image, instead of below like Nick does?

In the "Make a website" tutorial, Nick makes the gallery and has text below each image. what if I wanted to place that text to the right or left side of the image instead of below it?

1 Answer

Steven Parker
Steven Parker
231,008 Points

There's many ways to do this. Just a few would be:

  • make the caption and image both columns in a flex container
  • place the text before (for left) or after (right) the image and set display to inline
  • use the float property to place the image to the left or right
  • use the position property along with left or right offset values

You might try experimenting a bit, and if you need more help be sure to include your code. You can make a snapshot of your workspace and post the link to it here to share an entire project environment.