【发布时间】:2017-10-13 22:44:58
【问题描述】:
我一直在尝试这样做一段时间,但无法找到适合我的解决方案。我从不同高度的数据库中获取图像,我需要将它们垂直对齐到中间,标题水平对齐在每个图像的末尾。
请注意,所有图像都以不同的方式剪切,我无法更改,因此它们看起来不对齐并不重要。
更新:图形标题(跨度)也可能有不同的高度。
Here's what i need to accomplish
非常感谢一些帮助。
<section class="new-products container">
<div class="image-row">
<!--PRODUCT BLOCK-->
<div class="product-block col-lg-4 col-md-4 col-xs-12">
<figure>
<img src="https://s21.postimg.org/wr1wb9z0n/test2.jpg" class="img-responsive" alt="Foto Producto">
<figcaption>
<span class="category">category</span>
<span class="product-name">Product Name</span>
<span span="" class="price">price 6€</span>
</figcaption>
</figure>
</div>
<!--PRODUCT BLOCK END-->
<!--PRODUCT BLOCK-->
<div class="product-block col-lg-4 col-md-4 col-xs-12">
<figure>
<img src="https://s21.postimg.org/z9nlbykqv/test1.jpg" class="img-responsive" alt="Foto Producto">
<figcaption>
<span class="category">category</span>
<span class="product-name">Product Name</span>
<span span="" class="price">price 6€</span>
</figcaption>
</figure>
</div>
<!--PRODUCT BLOCK END-->
<!--PRODUCT BLOCK-->
<div class="product-block col-lg-4 col-md-4 col-xs-12">
<figure>
<img src="https://s21.postimg.org/h84ge5qpz/test3.jpg" class="img-responsive" alt="Foto Producto">
<figcaption>
<span class="category">category</span>
<span class="product-name">Product Name</span>
<span span="" class="price">price 6€</span>
</figcaption>
</figure>
</div>
<!--PRODUCT BLOCK END-->
</div>
.image-row {
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-ms-flex-align: baseline;
-webkit-align-items: baseline;
align-items: baseline;
-webkit-box-align: baseline;
-moz-box-align: baseline;
}
.new-products {
text-align: center;
}
.product-block .category, .product-block .category-special {
font-size: .75em;
font-weight: 600;
}
.product-block {
margin: 0 0 2em;
}
.product-block span {
display: block;
}
.product-block .category, .product-block .category-special {
font-size: 1em;
font-weight: 600;
letter-spacing: .063em;
text-transform: uppercase;
}
.product-block .category {
color: #b10832;
}
【问题讨论】: