如何設置包含HTML或CSS圖標的塊的懸停?如何設置包含HTML或CSS圖標的塊的懸停?
<!doctype html>
<head>
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.4.0/css/font-awesome.min.css">
<body>
<a class="link1" href="www.facebook.com">
<div id="top_head">
<i class="fa fa-home">
</div>
</a>
<style>
.fa-home {
color: white;
font-size: 30px;
background-color: transparent;
}
#top_head {
background-color: blue;
display: block;
position: absolute;
top: 20px;
left: 300px;
height: 70px;
width: 100px;
}
link1:hover {
background-color: black;
width: 200px;
height: 200px;
}
</style>
</head>
</body>
</html>
下面是一個例子:
您在'link1:hover'選擇器的開頭忘了一個點。此外,你的HTML內外:身體永遠不會進入頭部。 –
請更好地解釋你想達到的目標以及卡住的位置 – Chris