按钮背景图片替换
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针对数字、字母有效。
<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针对数字、字母有效。
相关文章推荐
- IOS】自定义UIAlertView样式,实现可替换背景和按钮 此博文包含图片此博文包含视频 (2012-10-24 10:23:25)
- WPF 按钮背景图片替换设置
- IE7下按钮<input>不显示自定义背景图片
- IE7下按钮<input>不显示自定义背景图片
- css用背景图片替换超链文字
- IOS开发中如何自定义导航栏的按钮,文字和背景图片
- 自定义UIAlertView样式,实现可替换背景和按钮
- Extjs 图片按钮背景根据鼠标的over和out变化
- 自绘式按钮COwnerDrawBtn:可设置文本字体、文本颜色、按钮背景图片
- Android开发_如何设置按钮背景透明与半透明_图片背景透明
- 替换下拉框默认下拉按钮图片
- 18_状态选择器&按钮状态的背景图片
- iOS开发-简单图片背景替换(实现抠图效果)
- android 点击按钮切换背景图片(根据按钮点击的ID切换)
- windows编程 单击按钮改变窗体背景图片
- css圆角背景图片按钮-自适应内容大小
- c#WINFORM中如何为动态生成的按钮加背景图片
- c#WINFORM中如何为动态生成的按钮加背景图片
- iOS 背景图片。按钮高亮自定义背景
- Android Nine Patch图片及按钮背景