代码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
a{
display: inline-block;
width:120px;
height:58px;
line-height: 58px;
text-align: center;
text-decoration: none;
}
a:nth-child(1){
background-image: url(./images/bg1.png);
}
a:hover:nth-child(1){
background-image: url(./images/bg5.png);
}
a:nth-child(2){
background-image: url(./images/bg2.png);
position:relative;
}
a:nth-child(2) img{
display: none;
position:absolute;
top:70px;
left:0px;
}
a:hover:nth-child(2){
background-image: url(./images/bg6.png);
}
a:hover:nth-child(2) img{
display: block;
}
a:nth-child(3){
background-image: url(./images/bg3.png);
}
a:hover:nth-child(3){
background-image: url(./images/bg7.png);
}
a:nth-child(4){
background-image: url(./images/bg4.png);
}
a:hover:nth-child(4){
background-image: url(./images/bg8.png);
}
</style>
</head>
<body>
<a href="#">11111</a>
<a href="#">22222<img src="./images/code.jpg"></a>
<a href="#">33333</a>
<a href="#">44444</a>
</body>
</html>
效果图