我有这样的标记。
<ul class="products">
<li class="product pro first">
<a href="#">
<span class="onsale">Sale!</span>
<img width="100" height="140" title="battlefield" alt="battlefield" class="attachment-shop_catalog wp-post-image" src="http://web-vassets.ea.com/Assets/Resources/Image/FeaturedGame/battlefield-bad-company-2-thumb.png?cb=1340391602">
<h3>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem</h3>
<span class="price"><span class="strike-through"><span class="striked-text"><span class="amount">$ 67.00</span></span></span> <ins><span class="amount">$ 23.00</span></ins></span>
</a>
<a class="add_to_cart_button button product_type_simple" data-product_id="185" rel="nofollow" href="#">Add to cart</a>
</li>
<li class="product pro first">
<a href="#">
<span class="onsale">Sale!</span>
<img width="100" height="140" title="battlefield" alt="battlefield" class="attachment-shop_catalog wp-post-image" src="http://web-vassets.ea.com/Assets/Resources/Image/FeaturedGame/battlefield-bad-company-2-thumb.png?cb=1340391602">
<h3>Battle Field</h3>
<span class="price"><span class="strike-through"><span class="striked-text"><span class="amount">$ 67.00</span></span></span> <ins><span class="amount">$ 23.00</span></ins></span>
</a>
<a class="add_to_cart_button button product_type_simple" data-product_id="185" rel="nofollow" href="#">Add to cart</a>
</li>
<li class="product pro first">
<a href="#">
<span class="onsale">Sale!</span>
<img width="100" height="140" title="battlefield" alt="battlefield" class="attachment-shop_catalog wp-post-image" src="http://web-vassets.ea.com/Assets/Resources/Image/FeaturedGame/battlefield-bad-company-2-thumb.png?cb=1340391602">
<h3>Battle Field</h3>
<span class="price"><span class="strike-through"><span class="striked-text"><span class="amount">$ 67.00</span></span></span> <ins><span class="amount">$ 23.00</span></ins></span>
</a>
<a class="add_to_cart_button button product_type_simple" data-product_id="185" rel="nofollow" href="#">Add to cart</a>
</li>
</ul>
可以在此处查看现场演示示例http://tinkerbin.com/7dnpFPL3。您可以在一行中看到三列。在每一列的底部都有一个名为 的按钮Add To Cart
。现在,正如您在每一列中看到的那样,内容的长度不同。此内容长度将按钮推到底部。最后两列的内容较少,这就是按钮位于内容中间的原因。现在我希望像第一个内容一样,最后两个内容的按钮位置应该位于每个内容 div 的底部。无论内容的长度如何,它都不会影响按钮的位置。该按钮应始终位于内容的底部。我不能给出任何固定的内容高度。因为每列内容的长度可能非常长。我无法将标记更改为使用表格而不是ul and li
. 的标记ul and li
是强制性的。在它们内部,我可以更改类名或标记。那么有人可以告诉我如何将按钮放在内容的底部吗?任何帮助和建议都将不胜感激。
我想要这样的输出