简体   繁体   English

如何更改字体真棒图标悬停颜色?

[英]How to change font awesome icon hover color?

Currently my html looks like this: 目前,我的html看起来像这样:

<div class="col-md-4 text-center">
  <i class="fa fa-2x fa-facebook wow bounceIn social"></i>
  <i class="fa fa-2x fa-twitter wow bounceIn social"></i>
  <i class="fa fa-2x fa-google-plus wow bounceIn social"></i>
</div>

I tried doing the following CSS and nothing happened: 我尝试执行以下CSS,但没有任何反应:

fa-facebook:hover {
  color: #006b33;
}

I'm totally new to font awesome, so any help would be appreciated! 我对字体真是太陌生了,所以我们将不胜感激!

You've got a typo - fa-facebook needs the . 您输入错误fa-facebook需要. in front of it, since it's a class selector. 在它前面,因为它是一个类选择器。

.fa-facebook:hover { ... }

Just write- 写吧-

.fa-facebook:hover {
    color: #006b33;
}

Since you are using a 'class' you have forgotten to write '.'(dot) before the class name. 由于您使用的是“类”,因此您忘记在类名之前写“。”(点)。

If it would have been an 'id' then use '#'(hash) instead of the dot. 如果它是一个“ id”,则使用“#”(哈希)代替点。 The rest would be the same. 其余的将是相同的。

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

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