簡體   English   中英

當一個div的內容增加時,擴展所有div的高度

[英]expand all div height when content of one div increase

我在下面的代碼中迭代對象集,並將其詳細信息填充到div中的錨標記中。 一些細節可以包含長描述。 我想擴大所有錨標簽的高度。

<div class="col-xs-6 col-md-3 offer-item-button" ng-repeat="offer in activeOffers">
    <a href="#/products"  class="thumbnail" ng-click="onLocalOfferClick(offer,store)">
        <h5 class="text-right">#{{offer.SlotId}}</h5>
        <h4 class="text-bold">{{offer.ProductName}}</h4>
        <h5 class="text-bold">$ {{offer.ProductPrice | number:2}}</h5>
        <h6 >{{offer.Description}}</h6>
    </a>
</div>

JS提琴手

如果任何項目都有詳細說明,則需要增加其高度以適合整個內容。 其他div也需要達到相同的高度

我該如何解決?

您可以在標簽上使用。

height:100%;

box-sizing:border-box;

為div添加css屬性:

width:500px;(您選擇的寬度)

並為錨標記中的每個元素添加css屬性:

寬度:100%;自動換行:斷行;

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM