【发布时间】:2021-10-27 15:19:39
【问题描述】:
我一直在努力将图像图标(不是字体图标)与标题和文本对齐。
我找到了一些很好的例子来说明如何做到这一点,但不是用标题,如果是这样,它使用了我试图避免的 fontawesome 图标。
.soccer-icon {
width: 50px;
}
.icon-header {
font-size: 18px;
line-height: 32px;
display: block !important;
padding-right: 20px
}
.icon-area {
display: flex;
align-items: center;
}
<div class="icon-area">
<p>
<img class="soccer-icon" src="https://cdn1.iconfinder.com/data/icons/sports-balls-4/32/balls_filled_outline-01-512.png" />
</p>
<h3 class="icon-header">Paper Ballot Inspection</h3>
<p>A full count of the ballots, including scanning and visual inspection of all ballots.</p>
</div>
【问题讨论】:
-
我运行了您提供的内容,他们排成一列。您是否更想将文本与图像的中间对齐?
-
@Brandon 他希望文本堆叠。不是并排
标签: html css icons html-heading