[英]use css attributes “filter: alpha(opacity=70);” and “background-image: url(image.png);” on input box
可以使两个人单独工作,但无法使他们一起工作。 这是在Windows侧边栏小工具中使用的。
形成:
<form name="llPeople" action="URL" method="get" target="newwindow">
<input id="phonebook" class="blur" type="text" name="peo_name" size="15" value="Search Phonebook.."
onFocus="document.getElementById('phonebook').value = ''; document.getElementById('phonebook').className = 'focus';"
onBlur="document.getElementById('phonebook').value = 'Search Phonebook..'; document.getElementById('phonebook').className = 'blur';" />
</form>
CSS:
#phonebook.focus
{
background-image: url(images/searchBack.png);
background-repeat: no-repeat;
width: 124px;
height: 16px;
position: relative;
}
#phonebook.blur
{
background-image: url(images/searchBackW.png);
background-repeat: no-repeat;
width: 124px;
height: 16px;
position: relative;
}
#intranet
{
width: 124px;
height: 16px;
}
input
{
font-size: 10px;
filter: alpha(opacity=70);
}
我认为您需要一个“背景色”,因为现在它是“透明的”,您可以使用:
background-color: #fff;
谢谢! 将其添加到其他属性之上可以完美地工作:
#phonebook.focus
{
background-color: #fff;
background-image: url(images/searchBack.png);
background-repeat: no-repeat;
width: 124px;
height: 16px;
position: relative;
}
#phonebook.blur
{
background-color: #fff;
background-image: url(images/searchBackW.png);
background-repeat: no-repeat;
width: 124px;
height: 16px;
position: relative;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.