我想佈局看起來像這樣,但也是響應式(以便標題+段落都保持位於圖標的左側)。如何將圖標放在標題的右側?
CSS:
.feature {
position: relative;
border: 1px solid #000;
}
.circle {
height: 2.5rem;
width: 2.5rem;
background-color: #64beeb;
border-radius: 50%;
float: right;
}
.icon {
font-size: 1.75rem;
color: #fff;
}
HTML:
<div class="feature">
<div class="text text-right">
<p class="h2">Diversity of Content</p>
<p class="descrip">Dive deep and share themed content across various topics based on your audience</p>
</div>
<div class="circle text-center">
<i class="icon ion-android-bulb"></i>
</div>
</div>
你可以刪除'浮彎曲;',它自動定位/調整大小子項,以適應並排側。 *(您可能還需要在'.circle'上放置'flex-shrink:0',以確保它不會「縮小到合適」。)* – Santi