简体   繁体   中英

use css attributes “filter: alpha(opacity=70);” and “background-image: url(image.png);” on input box

can get both working individually, but am unable to get them working together. this is for use in a windows sidebar gadget.

form:

<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;

thanks! adding that above the other properties worked perfectly:

#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;
  }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM