5个a,给a添加背景图片即可
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style>
a{
width: 120px;
height: 58px;
display: inline-block;
text-align: center;
text-decoration: none;
font: 700 17px/50px "微软雅黑";
}
.one{
background-image: url(images/bg1.png);
}
.two{
background-image: url(images/bg2.png);
} .three{
background-image: url(images/bg3.png);
} .for{
background-image: url(images/bg4.png);
}
</style>
</head>
<body>
<a href="#" class="one">五彩导航条</a>
<a href="#" class="two">五彩导航条</a>
<a href="#"class="three">五彩导航条</a>
<a href="#" class="three">五彩导航条</a>
<a href="#" class="for">五彩导航条</a>
</body>
</html>
中间有空隙是因为a在不同的行中,让a在同一行即可
五彩导航条<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style>
a{
width: 120px;
height: 58px;
display: inline-block;
text-align: center;
text-decoration: none;
font: 700 17px/50px "微软雅黑";
}
.one{
background-image: url(images/bg1.png);
}
.two{
background-image: url(images/bg2.png);
} .three{
background-image: url(images/bg3.png);
} .for{
background-image: url(images/bg4.png);
}
</style>
</head>
<body>
<a href="#" class="one">五彩导航条</a><a href="#" class="two">五彩导航条</a><a href="#"class="three">五彩导航条</a><a href="#" class="three">五彩导航条</a><a href="#" class="for">五彩导航条</a>
</body>
</html>
网友评论