gpt4 book ai didi

html - 在文本旁边对齐 Font Awesome 图标

转载 作者:搜寻专家 更新时间:2023-10-31 23:19:34 24 4
gpt4 key购买 nike

如何使图标看起来整洁?我的代码粘贴在下面。看起来像 this 但我希望它看起来像 this

我试着把它放在表格中,然后与每个 td 左对齐,但图标被向下移动了。有什么办法吗?谢谢

<p class="for-font-size"><span class="fa fa-calendar"></span> July 25, 2017</p>
<p class="for-font-size"><span class="fa fa-map-marker"></span> Sample City</p>
<p class="for-font-size"><span class="fa fa-venus-mars"></span> Male</p>
<p class="for-font-size"><span class="fa fa-envelope"></span> sample-email@gmail.com</p>
<p class="for-font-size"><span class="fa fa-phone"></span> +12 34567890</p>

最佳答案

您可以使用 Font Awesome Fixed Width Icons (fa-fw)List Icons (fa-ul + fa-li)

<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" />

<p><u><code>fa-fw</code> class</u></p>
<p><span class="fa fa-calendar fa-fw"></span> July 25, 2017</p>
<p><span class="fa fa-map-marker fa-fw"></span> Sample City</p>
<p><span class="fa fa-venus-mars fa-fw"></span> Male</p>
<p><span class="fa fa-envelope fa-fw"></span> sample-email@gmail.com</p>
<p><span class="fa fa-phone fa-fw"></span> +12 34567890</p>

<p><u><code>fa-ul</code> + <code>fa-li</code> class</u></p>
<ul class="fa-ul">
<li><span class="fa fa-calendar fa-li"></span> July 25, 2017</li>
<li><span class="fa fa-map-marker fa-li"></span> Sample City</li>
<li><span class="fa fa-venus-mars fa-li"></span> Male</li>
<li><span class="fa fa-envelope fa-li"></span> sample-email@gmail.com</li>
<li><span class="fa fa-phone fa-li"></span> +12 34567890</li>
</ul>

关于html - 在文本旁边对齐 Font Awesome 图标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45301774/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com