2013-07-17 11:18:43 纯DIV+CSS圆角背景随按钮文字增多而增宽自适应,鼠标经过背景变化按钮型模块。
纯DIV+CSS圆角背景随按钮文字增多而增宽自适应,鼠标经过背景变化按钮型模块。
自适应文字多少而背景按钮型截图
1、此CSS模块CSS代码:
- *{margin:0; padding:0;}
- body{padding:10px; font-size:12px;}
- h1{margin:0; padding:10px 0; font-size:14px; font-weight:bold;}
- .div a{background:url(HTML8.gif) left 0; color:#fff; text-decoration:none;
height:30px; float:left; cursor:hand; margin:0 5px 0 0;}- .div a:hover{background:url(HTML8.gif) left -30px;height:30px;}
- .div a span{background:url(HTML8.gif) right 0; padding:7px 8px 7px 0;
margin:0 0 0 8px; float:left; height:16px;}- .div a:hover span{background:url(HTML8.gif) right -30px; color:#000;
padding:7px 8px 7px 0; margin:0 0 0 8px; height:16px; }
2、此模块HTML源代码片段:
- <div class="div">
- <a href="//www.yfnd.net/"><span>首页</span></a>
- <a href="//www.yfnd.net/" target="_blank"><span>DIV CSS</span></a>
- <a href="//www.yfnd.net/css/" target="_blank"><span>DIV CSS模块</span></a>
- <a href="//www.yfnd.net/peixun/" target="_blank"><span>学习CSS上HTML8!</span></a>
- <a href="//www.yfnd.net/shouce/" target="_blank">
<span>CSS手册 可以查询常见属性</span></a>- </div>
3、圆角背景谁文字增加而自适应,鼠标经过同时背景变化。
随需图片素材:
所用素材图片,可随自己需求改变
4、在线演示:查看案例
5、打包下载(包括图片素材+源代码)