<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<title>制作水平导航栏</title>
<style type="text/css">
ul{
list-style-type:none;/*无下划线*/
}
a{
display: block;/*记得把a标签设置成block块元素*/
height:30px;
line-height:30px;/*文字正中间*/
width: 100px;
float:left;
text-align:center;
/*text-indent: 5px;如果不想让文字居中,可以选着缩进*/
}
ul a:link, ul a:visited {
font-size: 16px;
color: black;
text-decoration: none;/*超链接无下划线*/
}
ul a:hover, ul a:active {
font-size: 16px;
background-color: #be3948;
text-decoration: none;
}
</style>
</head>
<body>
<h3>课程难度</h3>
<ul>
<li><a href="#">全部</a></li>
<li><a href="#">初中</a></li>
<li><a href="#">中级</a></li>
<li><a href="#">高级</a></li>
</ul>
</body>
</html>
制作水平导航栏
最新推荐文章于 2022-12-19 16:08:57 发布