Web前端开发,自学笔记整理
导航效果
1.导航效果1
完整代码
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>导航效果</title>
<style type="text/css">
* {
margin: 0;
padding: 0;
}
.box {
width: 1000px;
height: 42px;
background: orange;
margin: 50px auto;
}
.box li {
float: left;
list-style: none;
/* border-right: 1px solid gray;*/
/*调整盒子大小*/
padding-right: 2px;
background: url(img/nav1-2.png) no-repeat right center;
}
.box li a {
text-decoration: none;
color: gray;
padding: 0 50px;
height: 37px;
line-height: 37px;
background: url(img/nav1-1.png);
display: block;
}
.box li a:hover {
background: orange;
}
</style>
</head>
<body>
<div class="box">
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">About us</a></li>
<li><a href="#">Services</a></li>
<li><a href="#">Clients</a></li>