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

Css常用操作——————导航栏

时间:2016-05-14 01:14:45      阅读:178      评论:0      收藏:0      [点我收藏+]

标签:css常用操作——————导航栏

一、垂直导航栏

ul{
    list-style-type: none;
    margin: 0px;
    padding: 0px;
}

a:link,a:visited{
    text-decoration: none;
    display: block;
    background-color: aqua;
    color: black;
    width: 50px;
    text-align: center;
}

a:active,a:hover{
    background-color: crimson;
}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>导航栏</title>
    <link href="style.css" type="text/css" rel="stylesheet">
</head>
<body>

    <ul>
        <li><a href="#">导航1</a></li>
        <li><a href="#">导航2</a></li>
        <li><a href="#">导航3</a></li>
        <li><a href="#">导航4</a></li>
    </ul>

</body>
</html>

二、水平导航栏

ul{
    list-style-type: none;
    margin: 0px;
    padding: 0px;
    background-color: aqua;
    width: 250px;
    text-align: center;
}

a:link,a:visited{
    font-weight: bold;
    text-decoration: none;
    background-color: aqua;
    color: black;
    width: 50px;
    text-align: center;
}

a:active,a:hover{
    background-color: crimson;
}

li{
    display: inline;
    padding-left: 5px;
    padding-right: 5px;
}

Css常用操作——————导航栏

标签:css常用操作——————导航栏

原文地址:http://11317783.blog.51cto.com/11307783/1773188

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