CSS设计圆角自适应按钮教程
get新技能是需要付出行动的,即使看得再多也还是要动手试一试。今天图老师小编跟大家分享的是CSS设计圆角自适应按钮教程,一起来学习了解下吧!
html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
head
title/title
meta http-equiv="Content-Type" content="text/html; charset=gb2312" /
style type="text/css"
!--
*{padding:0px;margin:0px;}
body{font-size:12px;}
h2{margin:50px;}
a{text-decoration:none;background:url(http://www.w3css.com/1.jpg) 0 0;float:left;color:#fff;margin:0px 60px 0px 0px; cursor:pointer;}
a span{ position:relative;background: url(http://www.w3css.com/1.jpg) top right;line-height: 25px;margin:0 -30px 0 30px; padding-right:30px;float:left;}
a:hover{background: url(http://www.w3css.com/1.jpg) left -25px;height:25px;float:left;margin:0px 60px 0px 0px;}
a:hover span{background: url(http://www.w3css.com/1.jpg) right -25px;line-height: 25px;margin:0 -30px 0 30px; padding-right:30px;float:left;color:#fff;}
--
/style
/head
body
h2自适应宽度按钮/h2
a href="" title="nogo"span自适应/span/a
a href="" title="nogo"span自适应宽度/span/a
a href="" title="nogo"span自适应宽度,对吧!/span/a
/body
/html