我的帖子標題在這裏可能會引起誤解。首先看看我目前的HTML: bootstrap 3將div中的文本內容用於水平對齊
正如你所看到的,每一列的文本內容溢出到下一列。其次,它們中的每一個都不是水平對齊的。 (例如,view details
的鏈接不能直線對齊)。無論文本的長度如何,我都希望它們能夠保持一致。
這裏是我的HTML代碼:(這裏的內容是動態生成的,所以項目的數量將不同)。我在我的代碼中使用bootstrap 3。
<div class="row" style="box-shadow: 0 0 30px black;">
<div class="col-6 col-sm-6 col-lg-4">
<h3>2005 Volkswagen Jetta 2.5 Sedan (worcester http://www.massmotorcars.com) $6900</h3>
<p>
<small>2005 volkswagen jetta 2.5 for sale has 110,000 miles powere doors,power windows,has ,car drives excellent ,comes with warranty if you're ...</small>
</p>
<p>
<a class="btn btn-default" href="/search/1355/detail/" role="button">View details »</a>
<button type="button" class="btn bookmark" id="1355" >
<span class="
glyphicon glyphicon-star-empty "></span>
</button>
</p>
</div>
<!--/span-->
<div class="col-6 col-sm-6 col-lg-4">
<h3>2006 Honda Civic EX Sedan (Worcester www.massmotorcars.com) $7950</h3>
<p>
<small>2006 honda civic ex has 110,176 miles, has power doors ,power windows,sun roof,alloy wheels,runs great, cd player, 4 cylinder engen, ...</small>
</p>
<p>
<a class="btn btn-default" href="/search/1356/detail/" role="button">View details »</a>
<button type="button" class="btn bookmark" id="1356" >
<span class="
glyphicon glyphicon-star-empty "></span>
</button>
</p>
</div>
<!--/span-->
<div class="col-6 col-sm-6 col-lg-4">
<h3>2004 Honda Civic LX Sedan (worcester www.massmotorcars.com) $5900</h3>
<p>
<small>2004 honda civic lx sedan has 134,000 miles, great looking car, interior and exterior looks nice,has cd player, power windows ...</small>
</p>
<p>
<a class="btn btn-default" href="/search/1357/detail/" role="button">View details »</a>
<button type="button" class="btn bookmark" id="1357" >
<span class="
glyphicon glyphicon-star-empty "></span>
</button>
</p>
</div>
</div>
http://www.w3schools.com/ cssref/css3_pr_word-break.asp – waplet