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 How to Make a Website Styling Web Pages and Navigation Style the Image Captions

What's the best way to get the gallery list items to be equal height?

Nick seems to have paragraphs that all line up neatly with two lines of text on mobile - but what if some paragraphs are longer than others? This extends the height of the li, which messes with the alignment of the gallery.

My usual way of doing this would be to set a min-height in pixels on the li:


gallery li {

float: left;
width: 45%;
margin: 2.5%;
min-height: 200px;
background-color: #f5f5f5;
color: #bdc3c7;

} </code>

I know that frameworks like Foundation have an equalize class that helps set equal height - but is there a "correct" way of doing it in a scenario like this?

1 Answer

Absolutely. I guess I was getting ahead of myself. Thanks!