要求:使用HTML+CSS完成导航栏
CSS部分代码:
* {
margin: 0;
padding: 0;
}
a {
color: white;
font-size: 18px;
font-weight: bolder;
text-decoration: none;
}
ul, ol {
list-style: none;
}
.nav {
width: 900px;
height: 64px;
background-repeat: repeat-x;
background-color: #4a5059;
text-align: center;
}
.nav ul {
width: 900px;
height: 64px;
text-align: center;
}
.nav>ul>li {
width: 100px;
height: 64px;
float: left;
line-height: 64px;
}
.nav>ul>li:hover {
background-color: darkred;
cursor: pointer;
}
运行结果图: