我想布局看起来像这样,但也是响应式(以便标题+段落都保持位于图标的左侧)。如何将图标放在标题的右侧?
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