分享一个导航条哈(⊙o⊙)…

原文:http://www.sharejs.com/js/menu/1601

CSS样式表:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
<!--[if lt IE 9]>
 
        <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
 
    <![endif]-->   
 
    <style>
 
         
 
        body{
 
            background: #333 ;
 
            width: 610px;
 
            margin: 0 auto;
 
            font-family: Arial, Helvetica;
 
            font-size: small;
 
        }
 
         
 
        nav  {
 
            display: block;
 
            width: 100%;
 
            overflow: hidden;
 
        }
 
         
 
        nav ul {
 
            margin: 80px 0 20px 0;
 
            padding: .7em;
 
            float: left;
 
            list-style: none;
 
            background: #444;
 
            background: rgba(0,0,0,.2);
 
            -moz-border-radius: .5em;
 
            -webkit-border-radius: .5em;
 
            border-radius: .5em;   
 
            -moz-box-shadow: 0 1px 0 rgba(255,255,255,.2), 0 2px 1px rgba(0,0,0,.8) inset;
 
            -webkit-box-shadow: 0 1px 0 rgba(255,255,255,.2), 0 2px 1px rgba(0,0,0,.8) inset;
 
            box-shadow: 0 1px 0 rgba(255,255,255,.2), 0 2px 1px rgba(0,0,0,.8) inset;
 
        }
 
         
 
        nav li {
 
            float:left;
 
        }
 
         
 
        nav a {
 
            float:left;
 
            padding: .8em 1.5em;
 
            text-decoration: none;
 
            color: #555;
 
            text-shadow: 0 1px 0 rgba(255,255,255,.5);
 
            font: bold 1.1em/1 'trebuchet MS', Arial, Helvetica;
 
            letter-spacing: 1px;
 
            text-transform: uppercase;
 
            border-width: 1px;
 
            border-style: solid;
 
            border-color: #fff #ccc #999 #eee;
 
            background: #c1c1c1;
 
            background: -moz-linear-gradient(#f5f5f5, #c1c1c1);
 
            background: -webkit-gradient(linear, left top, left bottom, from(#f5f5f5), to(#c1c1c1));
 
            background: -webkit-linear-gradient(#f5f5f5, #c1c1c1);
 
            background: -o-linear-gradient(#f5f5f5, #c1c1c1);
 
            background: -ms-linear-gradient(#f5f5f5, #c1c1c1);
 
            background: linear-gradient(#f5f5f5, #c1c1c1);           
 
         }
 
          
 
        nav a:hover, nav a:focus {
 
            outline: 0;
 
            color: #fff;
 
            text-shadow: 0 1px 0 rgba(0,0,0,.2);
 
            background: #fac754;
 
            background: -moz-linear-gradient(#fac754, #f8ac00);
 
            background: -webkit-gradient(linear, left top, left bottom, from(#fac754), to(#f8ac00));
 
            background: -webkit-linear-gradient(#fac754, #f8ac00);
 
            background: -o-linear-gradient(#fac754, #f8ac00);
 
            background: -ms-linear-gradient(#fac754, #f8ac00);
 
            background: linear-gradient(#fac754, #f8ac00);
 
        }
 
         
 
        nav a:active {
 
            -moz-box-shadow: 0 0 2px 2px rgba(0,0,0,.3) inset;
 
            -webkit-box-shadow: 0 0 2px 2px rgba(0,0,0,.3) inset;
 
            box-shadow: 0 0 2px 2px rgba(0,0,0,.3) inset;
 
        }
 
          
 
        nav li:first-child a {
 
            border-left: 0;
 
            -moz-border-radius: 4px 0 0 4px;
 
            -webkit-border-radius: 4px 0 0 4px;
 
            border-radius: 4px 0 0 4px;           
 
        }
 
         
 
        nav li:last-child a {
 
            border-right: 0;
 
            -moz-border-radius: 0 4px 4px 0;
 
            -webkit-border-radius: 0 4px 4px 0;
 
            border-radius: 0 4px 4px 0;           
 
        }
 
         
 
        /*----------------------*/
 
         
 
        #about
 
        {
 
            color: #999;
 
            text-align: center;
 
        }
 
         
 
        #about a
 
        {
 
            color: #eee;
 
        }
 
    </style>

 HTML代码:

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<nav>
 
    <ul>
 
        <li><a href="">Home</a></li>
 
        <li><a href="">Categories</a></li>
 
        <li><a href="">About</a></li>              
 
        <li><a href="">Portfolio</a></li>
 
        <li><a href="">Contact</a></li>
 
    </ul>
 
</nav>

 

比这个好看的导航条很多,但是感觉这个导航条就是简单,看着舒服···(⊙o⊙)…

P→很久没在博客园上发表东西了···以后改,以后坚持!

 

posted @   zh89233  阅读(248)  评论(0编辑  收藏  举报
编辑推荐:
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
点击右上角即可分享
微信分享提示