欢迎来到DIVCSS5查找CSS资料与学习DIV CSS布局技术!

DIV+CSS圆角背景随按钮文字增多而增宽自适应,鼠标经过背景变化按钮型模块。

圆角背景宽度自适应按钮
自适应文字多少而背景按钮型截图

1、此CSS模块CSS代码:

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

2、此模块HTML源代码片段:

  1. <div class="div"> 
  2. <a href="http://www.divcss5.com/"><span>首页</span></a> 
  3. <a href="http://www.divcss5.com/" target="_blank"><span>DIV CSS</span></a> 
  4. <a href="http://www.divcss5.com/template/" target="_blank"><span>DIV CSS模块</span></a> 
  5. <a href="http://www.divcss5.com/peixun/" target="_blank"><span>学习CSS上DIVCSS5!</span></a> 
  6. <a href="http://www.divcss5.com/shouce/" target="_blank">
    <span>CSS手册 可以查询常见属性</span></a> 
  7. </div> 

3、圆角背景谁文字增加而自适应,鼠标经过同时背景变化。

随需图片素材:

CSS模块素材,鼠标另存为
所用素材图片,可随自己需求改变

4、在线演示:查看案例

5、打包下载(包括图片素材+源代码)

如需转载,请注明文章出处和来源网址:http://www.divcss5.com/template/m580.shtml