我被卡住了,无论 <a>
是什么,我怎样才能使箭头垂直居中?标签字体大小是?
body {
font-family: Arial, 'sans-serif';
}
a {
font-weight: 500;
font-size: 30px;
color: #000;
}
i {
font-size: 12px !important;
font-weight: 300;
}
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" />
<div>
<a href="#">View Full Chart <i class="fa fa-chevron-right" aria-hidden="true"></i></a>
</div>
最佳答案
使用 i { vertical-align: middle; }
body {
font-family: Arial, 'sans-serif';
}
a {
font-weight: 500;
font-size: 30px;
color: #000;
}
i {
font-size: 12px !important;
font-weight: 300;
vertical-align: middle;
}
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" />
<div>
<a href="#">View Full Chart <i class="fa fa-chevron-right" aria-hidden="true"></i></a>
</div>
关于html - CSS 将中心 Font Awesome 图标垂直对齐到文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45097096/