简体   繁体   English

使用font-size调整字体真棒字体的大小

[英]Resizing Font Awesome Fonts with font-size

I have been trying to take two font images of a lock and stack them on top of each other. 我一直试图拍摄一把锁的两个字体图像,并将它们彼此堆叠。 Then, I wanted to resize one of them slightly so it looks like there is a border wrapped around the bottom one. 然后,我想略微调整其中一个的大小,以使底部好像有一个边框。 However, I am having a difficult time figuring out how to size it properly and I dont understand why font-size isn't working as expected. 但是,我很难弄清楚如何正确调整其大小,而且我不理解为什么字体大小无法按预期工作。 Could someone explain to me what I am doing wrong? 有人可以向我解释我在做什么错吗?

Here is the fiddle: http://fiddle.jshell.net/4LqeN/1694/ 这是小提琴: http : //fiddle.jshell.net/4LqeN/1694/

 i { text-align: center; padding: 1px 1px; display: inline-block; -moz-border-radius: 100px; -webkit-border-radius: 100px; border-radius: 100px; -moz-box-shadow: 0px 0px 2px #888; -webkit-box-shadow: 0px 0px 2px #888; box-shadow: 0px 0px 2px #888; } #lock-black{ font-size: 200% } 
 <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css"/> <span class="fa-stack"> <i id="lock-black" class="fa fa-lock fa-stack-2x "></i> <i id="lock=blue" class="fa fa-lock fa-stack-1x" style="color:blue" ></i> </span> 

Figured it out! 弄清楚了!

 i { text-align: center; padding: 1px 1px; display: inline-block; -moz-border-radius: 100px; -webkit-border-radius: 100px; border-radius: 100px; -moz-box-shadow: 0px 0px 2px #888; -webkit-box-shadow: 0px 0px 2px #888; box-shadow: 0px 0px 2px #888; } #lock-black{ font-size: 200%; } #lock-blue{ font-size: 150%; } 
 <link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"/> <span class="fa-stack"> <i id="lock-black" class="fa fa-lock fa-stack-2x "></i> <i id="lock-blue" class="fa fa-lock fa-stack-1x" style="color:blue" ></i> </span> 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM