I've seen this asked so many times, but what I'm trying doesn't seem to be working and I just need a bit of help/pointers in what I'm misunderstanding.
I read that display: table-cell
etc isn't the way to go if you want a fluid, responsive grid so I don't want to use that method.
I basically have a list of elements in a grid which should be three columns width.
<ul>
<li>
<img src="test_img.png" />
<p>Some title</p>
<p>Some content...</p>
</li>
</ul>
The amount of li
tags are dependent on how many items I have in my database so I never know the exact amount of items or content. But they are always in a three column grid.
My css looks like:
ul {
display: block;
list-style: none;
padding: 10px;
font-size: 0;
position: relative;
}
li {
font-size: 14px;
display: inline-block;
vertical-align: top;
width: 100%;
}
img {
width: 100%;
height: 250px;
}
It looks like this since I'm going mobile first. So this all works fine until I hit tablet.
I'm struggling to understand how I'm able to get all the li
tags to be the same height regardless of their content. I tried adding the ::after
pseudo selector to them and positioning the pseudo selector absolute with the parent relative but the height didn't seem to change.