Reputation: 255
When I look at my webpage, the images are not aligned. I would like the icons to be straightly aligned but there is a difference that look like it depends on the other cell, depending on how large is the container for writing the time:
I created a fiddle for the problem. Can you help me? The incorrect code seems to be the CSS:
#list_item_thumbs .item {
list-style: none;
margin: 0;
display: block;
clear: both;
overflow: visible;
border-bottom: 1px solid #ccc;
position: relative;
padding: 8px 0 0 0;
height: 88px;
}
Upvotes: 0
Views: 36
Reputation: 903
There are 2 solutions to this:
One is use a table, then the columns will automatically align.
The other is use fixed widths on your columns, give them classes .datetime, .image and .description
and apply a width to each.
.datetime {
display: block;
width: 25%;
}
.image {
display: block;
width: 25%;
}
.description {
display: block;
width: 50%;
}
Upvotes: 2
Reputation: 19111
Add this to your images:
#list_item_thumbs .item_img img {
display: block;
margin: 0 auto;
}
I would also add this to the .item_age
class to further help with alignment:
#list_item_thumbs .item_age {
min-width: 4em;
}
https://jsfiddle.net/8172md5g/1/
Upvotes: 1