I've been trying to center my text with my Fontastic.me icons.
Here's my code:
HTML:
<html>
<div id="info">
<ul>
<li id="chat"><span class="icon-comment-discussion"></span><p>We offer the best & simplest chat system on the web.</p></li>
</ul>
</div>
</html>
and my CSS:
#chat {
line-height: 72px;
vertical-align: middle;
}
It doesn't line up at all, and nothing changes when I change the vertical-align option. I'm thinking maybe it's because my text is in a paragraph tag; but I wanted to ask here first.
Solved: I added the vertical-align: middle; to:
#chat span {
}
it worked perfectly.
作为标准的段落将应用边距,您可以尝试删除边距以查看是否有帮助,或将图标放在段落中。
p{ margin:0; }
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.