标签:int ace pre 修改 opacity value highlight pac ref
方法一:
::-webkit-input-placeholder { /* WebKit browsers */ color: #fff; } :-moz-placeholder { /* Mozilla Firefox 4 to 18 */ color: #fff; opacity: 1; } ::-moz-placeholder { /* Mozilla Firefox 19+ */ color: #fff; opacity: 1; } :-ms-input-placeholder { /* Internet Explorer 10+ */ color: #fff; }
/* opacity: 1;是为了修改FF的默认透明度导致颜色偏差; */
方法二:
<input type="text" value="placeholder text" onfocus="if(!this.haswriting){this.style.color=‘#000‘; this.value=‘‘;}" onblur="if(!this.value){this.style.color=‘#f00‘; this.value=‘placeholder text‘; this.haswriting=false;}else{this.haswriting=true};" style="color: #f00;"/>
标签:int ace pre 修改 opacity value highlight pac ref
原文地址:http://www.cnblogs.com/loewe0202/p/7929582.html