当前位置:编程学习 > JS >>

CSS美化的漂亮分页按钮

利用CSS美化的一些漂亮的分页按钮样式,类似水晶按钮的风格,自动适应文字长度,分页中可以用,菜单和选项卡也可以用,使用此背景要学会如何用CSS控制一张图片选用区域,相信大家会喜欢的。
答案: <!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=utf-8" />
<title>CSS漂亮的分页按钮</title>
<style type="text/css">
*{ margin:0; padding:0; font-size:12px;}
div{ text-align:center;}
div a{ display:inline-block; background:url(/jscss/demoimg/200909/q1.gif) no-repeat left top; text-decoration:none; padding-left:8px; color:#FFF;}
div a:hover{ background:url(/jscss/demoimg/200909/q1.gif) no-repeat left -24px; color:#000;}
div a span{display:inline-block; background:url(/jscss/demoimg/200909/q1.gif) no-repeat right top;height:24px;line-height:24px;padding-right:8px; cursor:pointer;}
div a:hover span{ background:url(/jscss/demoimg/200909/q1.gif) no-repeat right -24px;}
</style>
</head>
<body>
<div>
<a href="#"><span>上一页</span></a>
    <a href="#"><span>1</span></a>
    <a href="#"><span>2</span></a>
    <a href="#"><span>3</span></a>
    <a href="#"><span>下一页</span></a>
</div>
</body>
</html>

上一个:DIV+css完美仿真Textarea
下一个:表单检测及表单提示

CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,