Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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:

<code>

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!