按钮背景图片替换

1.

<style>
.class1{
background:url(http://image2.sina.com.cn/home/07index/sinahome_ws_025.gif) }

.class2{
background:url(http://image2.sina.com.cn/home/07index/sinahome_ws_024.gif)
}
input{
line-height:24px;
width:64

}
</style>

<input type="button" value="按纽" class="class1" οnmοuseοver="this.className='class2'" οnmοuseοut="this.className='class1'" />

 

 

2.

<input type=button style='background-image(url(a.gif))'

οnmοuseοver="this.style.backgroundImage='url(b.gif)'"

οnmοuseοut='this.style.backgroundImage='url(a.gif)''/>

鼠标放上去显示b图片,离开显示a图片。

onmouseover在css中的写法:改变按钮颜色。

<style type="text/css">

οnmοuseοver=function()

{

this.style.backgroundColor="#000000"

},

οnmοuseοut=function()

{

this.style.backgroundColor="#ffffff"

}

)

}

</style

<input type="button" class="button" value="">

鼠标移入移出<input>颜色的变化:

<input type="submit" value="" onMouseout="this.style.color='blue'"

onMouseover="this.style.color='red'">

图片按钮加上链接点击后出现虚线边框的解决方法:

一:

<head>

<style>

a,a:visited,a:hover{text-decoration:none;}

img{border:0}

</style>

</head>

二:

<a href="" onFocus="this.blur()"><img src=""></a>

三:

<input hideFocus="true">

<button hideFocus="true">

解决中文汉字、英文字母,数字不换行问题:

在<td>里加入style="white-space:normal;word-break:break-all;"

white-space:normal针对汉字有效,word-break:break-all针对数字、字母有效。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值