我希望将文本与Font Awesome图标对齐 - 使用内联样式。
但是,这不起作用。有人可以帮忙吗?
<div>
<span style="font-size: 17px !important; font-family: 'Francois One', sans-serif; color: #000000;">Rent single videos for $1.00 with Credit Card, Bitcoin or PayPal</span>
<span class="fa fa-cc-mastercard fa-3x" style=" vertical-align: middle;"></span>
<span class="fa fa-cc-visa fa-3x" style=" vertical-align: middle;"></span>
<span class="fa fa-btc fa-3x" style=" vertical-align: middle;"></span>
<span class="fa fa-cc-paypal fa-3x" style=" vertical-align: middle;"></span>
</div>
答案 0 :(得分:0)
要使其工作,无论文字的字体大小如何,您都需要将vertical-align: middle;
添加到第一个范围:
<div>
<span style="font-size: 17px !important; font-family: 'Francois One', sans-serif; color: #000000; vertical-align: middle;">Rent single videos for $1.00 with Credit Card, Bitcoin or PayPal</span>
<span class="fa fa-cc-mastercard fa-3x" style=" vertical-align: middle;"></span>
<span class="fa fa-cc-visa fa-3x" style=" vertical-align: middle;"></span>
<span class="fa fa-btc fa-3x" style=" vertical-align: middle;"></span>
<span class="fa fa-cc-paypal fa-3x" style=" vertical-align: middle;"></span>
</div>