Chinaunix首页 | 论坛 | 博客
  • 博客访问: 7258731
  • 博文数量: 5645
  • 博客积分: 9880
  • 博客等级: 中将
  • 技术积分: 68080
  • 用 户 组: 普通用户
  • 注册时间: 2008-04-28 13:35
文章分类

全部博文(5645)

文章存档

2008年(5645)

我的朋友

分类:

2008-04-28 14:19:29

下载本文示例代码

先来看张图片:

uploads/200711/20_101355_2.gif
原理就是通过背景的左对齐和右对齐用A标签和span标签组合出一个完整的圆角矩形。再通过hover标签去滑动图片。ok,看看代码吧。

CSS:

*{margin:0; padding:0;}
body{padding:10px; font-size:12px;}
h1{margin:0; padding:10px 0; font-size:14px; font-weight:bold;}
a{background:url(1.gif) left 0; color:#fff; text-decoration:none; height:30px; float:left; cursor:hand; margin:0 5px 0 0;}
a:hover{background:url(1.gif) left -30px;height:30px;}
a span{background:url(1.gif) right 0; padding:7px 8px 7px 0; margin:0 0 0 8px; float:left; height:16px;}
a:hover span{background:url(1.gif) right -30px; color:#000; padding:7px 8px 7px 0; margin:0 0 0 8px; height:16px; }

先来看张图片:

uploads/200711/20_101355_2.gif
原理就是通过背景的左对齐和右对齐用A标签和span标签组合出一个完整的圆角矩形。再通过hover标签去滑动图片。ok,看看代码吧。

CSS:

*{margin:0; padding:0;}
body{padding:10px; font-size:12px;}
h1{margin:0; padding:10px 0; font-size:14px; font-weight:bold;}
a{background:url(1.gif) left 0; color:#fff; text-decoration:none; height:30px; float:left; cursor:hand; margin:0 5px 0 0;}
a:hover{background:url(1.gif) left -30px;height:30px;}
a span{background:url(1.gif) right 0; padding:7px 8px 7px 0; margin:0 0 0 8px; float:left; height:16px;}
a:hover span{background:url(1.gif) right -30px; color:#000; padding:7px 8px 7px 0; margin:0 0 0 8px; height:16px; } 下载本文示例代码


CSS打造自适应宽度按钮CSS打造自适应宽度按钮CSS打造自适应宽度按钮CSS打造自适应宽度按钮CSS打造自适应宽度按钮CSS打造自适应宽度按钮CSS打造自适应宽度按钮CSS打造自适应宽度按钮CSS打造自适应宽度按钮CSS打造自适应宽度按钮CSS打造自适应宽度按钮CSS打造自适应宽度按钮CSS打造自适应宽度按钮CSS打造自适应宽度按钮CSS打造自适应宽度按钮
阅读(296) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~