有什么方法可以将Awesome Icon字体的高度和宽度设置为其父容器的全部宽度和高度?

问题描述 投票:0回答:1

我想将Font Awesome图标的高度和宽度设置为其父容器的完整宽度和高度。

CSS

.icon-container {
width:30px;
height:30px;
}
.fa-facebook-square {
//what should be here
//font-size is not working properly in this scenario
}

HTML

<div class="icon-container">
 <i class="fab fa-facebook-square"></i>
</div>
css height width font-awesome parent
1个回答
0
投票

检查此->https://jsfiddle.net/2na108rc/1/

 <i class="fab fa-facebook-square"></i>


.fa-facebook-square {
   font-size: 200px;
   font-weight: 900;
 }
© www.soinside.com 2019 - 2024. All rights reserved.