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针对数字、字母有效。