您的位置:首页 > 其它

按钮背景图片替换

2010-05-02 08:43 260 查看
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" onmouseover="this.className='class2'" onmouseout="this.className='class1'" />

2.

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

onmouseover="this.style.backgroundImage='url(b.gif)'"

onmouseout='this.style.backgroundImage='url(a.gif)''/>

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

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

<style type="text/css">

onmouseover=function()

{

this.style.backgroundColor="#000000"

},

onmouseout=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针对数字、字母有效。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: