【 tulaoshi.com - Web开发 】
!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
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