我有以下代码:
.stat {
color: #4c4c4c !important;
float: left !important;
font-size: 10px !important;
line-height: 17px !important;
text-align: center !important;
text-decoration: none !important;
width: auto !important;
}
.stat:hover {
color: #747474 !important
}
.stat strong {
display: block !important;
font-size: 22px !important;
line-height: 25px !important
}
<div>
<a href="#" class="stat">
<strong>3333</strong> vic
</a>
<a href="#" class="stat">
<strong>60</strong> 0986001661
</a>
<a href="#" class="stat">
<strong>117</strong> [email protected]
</a>
</div>
我想知道如何对齐 icon 而不是 label strong
。像这样的东西:
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<div>
<a href="#" class="stat">
<i class="material-icons">power_settings_new</i> vicsss
</a>
<a href="#" class="stat">
<i class="material-icons">power_settings_new</i> 98988888
</a>
<a href="#" class="stat">
<i class="material-icons">power_settings_new</i> [email protected]
</a>
</div>
包装器必须具有相对位置,并且子图标或绝对图标
很简单,你只需要让标签
i
有display:block
并且链接文本a
居中。与您已经拥有的非常相似的东西(我只是添加了其他东西以使其更加华丽):