1、input标签中提示消息在IE9及以下不兼容问题;
支持HTML5的浏览器可以使用:
<input type="text" id="why" placeholder="请填写维护原因">
IE不支持的情况下可以如下使用:
<input id="why" type="text" value="请填写维护原因" οnfοcus="if (value =='请填写维护原因'){value =''}"οnblur="if (value ==''){value='请填写维护原因'}"/>
另外在密码框中显示提示信息,因为IE8不支持placeholder属性,上述input也无法满足,可以如下使用:
<input type="text" class="form-control" value="口令" id="text"/>
<input type="password" class="form-control" name="password" id="password" />
<style type="text/css">
#pwd{
display:none;
}
</style>
<script type="text/javascript">
window.οnlοad=function(){
var tx=document.getElementById("text");
var pwd=document.getElementById("password");
tx.οnfοcus=function(){
if(this.value!="口令")
return;
this.style.display="none";
pwd.style.display="block";
pwd.value="";
pwd.focus();
}
pwd.οnblur=function(){
if(this.value!=""){
return;
}
this.style.display="none";
tx.style.display="";
tx.value="口令";
}
}
</script>
2、关于css中颜色的渐变问题;
一般线性渐变 -- linear-gradient
background:linear-gradient(#75B8D9,#fff);
在IE8中是不支持linear-gradient的,使用如下:
filter:alpha(opacity=100 finishopacity=50 style=1 startx=0,starty=0,finishx=0,finishy=150) progid:DXImageTransform.Microsoft.gradient(startcolorstr=#75B8D9,endcolorstr=#ffffff,gradientType=0);
-ms-filter:alpha(opacity=100 finishopacity=50 style=1 startx=0,starty=0,finishx=0,finishy=150) progid:DXImageTransform.Microsoft.gradient(startcolorstr=#75B8D9,endcolorstr=#ffffff,gradientType=0);
关于颜色渐变的问题下面网址可以有用
http://www.jb51.net/css/511433.html