在我的網站主頁(https://abbaproperty.000webhostapp.com/)我有三個div的直列看起來像這樣:如何讓這三個對齊div響應?
但在稍小的卵石(不移動)觀看時,它看起來像這樣:
它們不再是一樣的高度。儘管我已經添加了一些響應式CSS,因此在較小的移動設備上看起來像這樣。
所以在這裏,我的問題是,有一個甜蜜點,其中這些div將不顯示很好的響應,我不能想即使是合乎邏輯的CSS來解決這個問題的。誰能幫忙?先謝謝你!
HTML:
<div class="container" style="width:100%; background-color:#205ba0; padding:30px;">
<div class="col-md-offset-3 col-md-2" align="center" style="color:white; border:2px solid white; font-size:12px; padding:10px;">
<div class="trip" style="background-color:white; margin-bottom:10px; padding-bottom:5px;">
<img src="https://abbaproperty.000webhostapp.com/wp-content/uploads/2017/05/rent.png" style="height:100px;">
</div>
<h2 style="font-weight:bold;">Renting? Landlords welcome.</h2>
A swift liason between landlords and tenants as a fair, independeant party, is just one of our services.<br><br>
<a href="https://abbaproperty.000webhostapp.com/index.php/property-management/" style="color:white;">Find out more ></a>
</div>
<div class="col-md-2" align="center" style="color:white; border:2px solid white; font-size:12px; padding:10px;">
<div class="trip" style="background-color:white; margin-bottom:15px;">
<img src="https://abbaproperty.000webhostapp.com/wp-content/uploads/2017/05/val.png" style="height:100px;">
</div>
<h2 style="font-weight:bold;">Valuation? Sorted quickly.</h2>
Providing some of the most effecient valuations in town, we're here to help you sort out an important step.<br><br>
<a href="https://abbaproperty.000webhostapp.com/index.php/valuations/" style="color:white;">Find out more ></a>
</div>
<div class="col-md-2" align="center" style="color:white; border:2px solid white; font-size:12px; padding:10px;">
<div class="trip" style="background-color:white; margin-bottom:10px; padding-bottom:5px;">
<img src="https://abbaproperty.000webhostapp.com/wp-content/uploads/2017/05/sale.png" style="height:100px;">
</div>
<h2 style="font-weight:bold;">Selling? Now uncomplicated.</h2>
We aim to make selling easy. Our trained estate agents are constantly available to help.<br><br>
<a href="https://abbaproperty.000webhostapp.com/index.php/sell/" style="color:white;">Find out more ></a>
</div>
</div>
的[?如何保持兩個div是並排相同的高度(可能的複製https://stackoverflow.com/questions/2997767/how-do-i -keep-two-divs-that-side-the-same-height) – Santi
您可以嘗試使用flexbox:https://css-tricks.com/fluid-width-equal-height-列/ 或者如果您不能使用flexbox,請在列上設置最大高度並使用媒體查詢進行更新 – Maneesh
@ T.Doe嘗試儘可能避免內聯樣式。 – hungerstar