我的日子有点难过。我创建了一些图标放在一些链接旁边。链接具有“下划线”文本装饰效果,在悬停时应用于它们。我添加了图标,它非常适合,只是当锚标签悬停时图标没有下划线。我究竟做错了什么?
HTML
<a class="link" href="#">
<img src="images/home.png" alt="" id="home" class="icon"/>
home
</a>
<a class="link" href="about/">
<img src="images/about.png" alt="" id="about" class="icon"/>
About
</a>
<a class="link" href="contact/">
<img src="images/contact.png" alt="" id="contact" class="icon"/>
Contact
</a>
<a class="link" href="work/">
<img src="images/work.png" alt="" id="work" class="icon"/>
Work
</a>
CSS
#home {
width: 15px;
height: 15px;
}
#about {
width: 15px;
height: 15px;
}
#contact {
width: 19px;
height: 15px;
}
#work {
width: 16px;
height: 15px;
}
.link {
margin: 0;
padding: 0;
display: inline-block;
line-height: 50px;
width: 100px;
font-size: 18px;
font-family: arial;
}
.link:link {
color: #ffffff;
font-weight: bold;
text-decoration: none;
}
.link:visited {
color: #ffffff;
font-weight: bold;
text-decoration: none;
}
.link:active {
color: #ffffff;
font-weight: bold;
text-decoration: none;
}
.link:hover {
color: #ffffff;
font-weight: bold;
text-decoration: underline;
}
我很感激帮助。