码迷,mamicode.com
首页 > Web开发 > 详细

web水平菜单导航

时间:2017-03-09 20:20:10      阅读:229      评论:0      收藏:0      [点我收藏+]

标签:alt   hover   文件   htm   add   bsp   首页   center   oat   

效果:

技术分享

HTML代码:

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>菜单导航垂直菜单</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>

<body>
<ul>
<li><a href="#">首页</a></li>
<li><a href="#">课程</a></li>
<li><a href="#">班级</a></li>
<li><a href="#">作业</a></li>
<li><a href="#">作品</a></li>
<li><a href="#">活动</a></li>
<li><a href="#">联系</a></li>
</ul>
<p>&nbsp;</p>
</body>
</html>

CSS代码(文件名:style.css)

@charset "utf-8";
/* CSS Document */

/*样式清除*/
*{margin:0;
padding:0;

}

ul{
list-style:none; /*清除ul前面的点*/
}
li{float:left;}
a{ text-decoration:none;
display:inline-block;
height:30px;
line-height:30px;
width:80px;
background-color:rgba(0,51,204,0.3);
margin-left:2px;
text-align:center;
font-size:18px;
}
a:hover{
background-color:rgba(0,51,204,0.5);
}

web水平菜单导航

标签:alt   hover   文件   htm   add   bsp   首页   center   oat   

原文地址:http://www.cnblogs.com/jiangyuzhen/p/6527268.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!