时间:2021-07-01 10:21:17 帮助过:34人阅读
- <meta charset=" utf-8"><meta name="author" content="http://www.softwhy.com/"><title>蚂蚁部落</title><style type="text/css">.bt{ width:67px; height:23px; line-height:23px; background:url(mytest/demo/bt.jpg) no-repeat -4px -4px; border:0px;}.over{ width:67px; height:23px; line-height:23px; background:url(mytest/demo/bt.jpg) no-repeat -4px -30px; border:0px;}</style><input type="submit" value="登录" onmouseover="this.className='over'" onmouseout="this.className='bt'" class="bt">
以上代码实现了背景图片美化按钮,并且当鼠标放在按钮上和鼠标离开按钮时,能够切换背景图片。不过这里用到了将背景图片放在一张图片上的技术,如果大家还不够熟悉,可以点击相关链接了解相关内容。