仿163邮箱的按钮效果(0 位领导批示)

163邮箱是用JS来实现的,我这里用到了CSS伪类 hover

Demo http://www.zdyi.com/lab/mail163/

HTML

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>163邮箱按钮</title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top">
	<div id="logo"><img src="163logo.gif" alt="logo" /></div>
</div>
<div id="nav">
	<ul>
		<li><a href="#"><span class="left"></span><span class="center">发送</span><span class="right"></span></a><span class="img1"></span></li>
		<li><a href="#"><span class="left"></span><span class="center">存草稿</span><span class="right"></span></a><span class="img2"></span></li>
		<li><a href="#"><span class="left"></span><span class="center">贺卡</span><span class="right"></span></a><span class="img3"></span></li>
		<li><a href="#"><span class="left"></span><span class="center">查词典</span><span class="right"></span></a><span class="img4"></span></li>
	</ul>
</div>
</body>
</html>

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
* {
	margin:0;
	padding:0;
	font-size:12px;
}
 
#top {
	height:91px;
	background:url(f2.gif) repeat-x;
}
 
#logo {
	padding:6px;
}
 
#nav {
	height:37px;
	width:100%;
	background:url(f2.gif) repeat-x 0px -147px;
}
 
#nav ul {
	list-style:none;
	float:left;
	margin-top:4px;
}
 
#nav li {
	float:left;
	margin:0 6px;
}
 
#nav li a {
	display:block;
	height:26px;
	text-decoration:none;
	color:#444;
	cursor:pointer;
}
 
#nav li a span.center{	
	height:26px;
	float:left;
	padding:6px 3px 0 28px;
	*padding:7px 3px 0 28px;
	width:100%;
}
 
#nav li a:hover span.center{
	background:url(f2.gif) repeat-x 0px -250px;		
}
 
#nav li a span.left {
	float:left;
	width:5px;
	height:26px;
}
 
#nav li a:hover span.left {
	background:url(f1.gif) no-repeat -757px -16px;
}
 
#nav li a span.right {
	float:left;
	width:5px;
	height:26px;
}
 
#nav li a:hover span.right {
	background:url(f1.gif) no-repeat -781px -16px;
}
 
#nav li span.img1 {
	width:26px;
	height:13px;
	display:block;
	background:url(ico.gif) no-repeat -1318px -42px;
	position:relative;
	left:5px;
	bottom:20px;
}
 
#nav li span.img2 {
	width:14px;
	height:13px;
	display:block;
	background:url(ico.gif) no-repeat -1360px -42px;
	position:relative;
	left:8px;
	bottom:20px;
}
 
#nav li span.img3 {
	width:26px;
	height:13px;
	display:block;
	background:url(ico.gif) no-repeat -1393px -42px;
	position:relative;
	left:5px;
	bottom:20px;
}
 
#nav li span.img4 {
	width:17px;
	height:13px;
	display:block;
	background:url(ico.gif) no-repeat -1434px -42px;
	position:relative;
	left:8px;
	bottom:20px;
}

分享到新浪微博 推荐到豆瓣 分享到 Google Reader 加入Google书签 嘀咕一下 分享到饭否 分享到做啥 分享到叽歪 分享到鲜果 加入QQ书签 加入百度搜藏 加入雅虎书签 分享到垦一垦

银子曰:还没有领导题词?

请领导指示

验证码 (必须)

Additional comments powered by BackType

随机显示的10篇日志

评论最多的10篇日志

浏览最多的10篇日志