下面是代码。我试图让悬停在 Font-awesome 中工作。但它没有!请帮助..
<!DOCTYPE html>
<html>
<head>
<link href="//netdna.bootstrapcdn.com/font-awesome/3.0.2/css/font-awesome.css" rel="stylesheet">
<meta charset=utf-8 />
<title>JS Bin</title>
<style>
.icon-facebook-sign:before {color:lightblue;}
.icon-facebook-sign:hover{color:red;}
.icon-twitter-sign:hover{color:#00BEF6}
.icon-google-plus-sign:hover{color:red;}
</style>
</head>
<body>
<li style="float:left;">
<!-- start social bookmarks -->
<div style="font-size: 32px; color: grey;">
<i class="icon-facebook-sign" style="color:red; margin-left: 0px; :hover{color:lightblue;}">
</li>
<i class="icon-twitter-sign" style="margin-left: -12px;"></i>
<i class="icon-linkedin-sign" style="margin-left: -12px;"></i>
<i class="icon-google-plus-sign" style="margin-left: -12px;"></i>
</div>
<!-- end social bookmarks -->
</li>
</body>
</html>
最佳答案
在这里您只添加了 font-awesome
但不是 twitter-bootstrap
.将此链接添加到您的代码中并尝试。它会工作<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-combined.no-icons.min.css" rel="stylesheet">
<!DOCTYPE html>
<html>
<head>
<link href="//netdna.bootstrapcdn.com/font-awesome/3.0.2/css/font-awesome.css" rel="stylesheet">
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-combined.no-icons.min.css" rel="stylesheet">
<meta charset=utf-8 />
<title>JS Bin</title>
<style>
.icon-facebook-sign:before {color:lightblue;}
.icon-facebook-sign:hover{color:red;}
.icon-twitter-sign:hover{color:#00BEF6}
.icon-google-plus-sign:hover{color:red;}
</style>
</head>
<body>
<li style="float:left;">
<!-- start social bookmarks -->
<div style="font-size: 32px; color: grey;">
<i class="icon-facebook-sign" style="color:red; margin-left: 0px; :hover{color:lightblue;}">
</li>
<i class="icon-twitter-sign" style="margin-left: -12px;"></i>
<i class="icon-linkedin-sign" style="margin-left: -12px;"></i>
<i class="icon-google-plus-sign" style="margin-left: -12px;"></i>
</div>
<!-- end social bookmarks -->
</li>
</body>
</html>
关于html - Font Awesome ......悬停不工作为什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16910777/