您现在的位置: 万盛学电脑网 >> 程序编程 >> 网页制作 >> DivCSS教程 >> 正文

css按钮自适应实现原理是什么呢

作者:佚名    责任编辑:admin    更新时间:2022-06-22

我们为大家收集整理了关于css按钮自适应实现原理,以方便大家参考。

<!DOCTYPE html> 
<html> 
<head> 
<meta charset="UTF-8"> 
<style type="text/css"> 
.btn a{text-decoration:none;} 
.btn{display: inline-block; background: url(s_btn.png) no-repeat 0 0; height: 22px; line-height: 22px; color: #666; vertical-align:top;} 
.btn i{display:block;font-style: normal; font-size: 12px; padding: 0 10px; background:url(s_btn.png) no-repeat right -22px; } 
.btn:hover{text-decoration: none;color:#4c8136;background-position: 0 -44px;} 
.btn:hover i{background-position: right -66px;} 
.btn:active{background-position: 0 -88px;} 
.btn:active i{background-position: right -110px;} 
.btn_disabled, .btn_disabled:hover{background: url(../img/s_btn.png) no-repeat 0 -132px;cursor: default;} 
.btn_disabled i, .btn_disabled:hover i, .s_btn_disabled:active i{background-position: right -154px;color:#999;} 
</style> 
</head> 
<body> 
<a href="#" class="btn"> <i>这是按钮</i> </a> 
<a href="#" class="btn"> <i>按钮</i> </a> 
</body> 
</html>

希望大家可以学会css按钮自适应实现原理.想了解更多精彩内容,请关注我们的网站!

相关推荐:

css实现鼠标滑过改变文字的方法