一:要解决的问题时:在ie6-ie11下兼容下面透明上传文件button的效果。
实现方式通过滤镜实现。
二:效果图例如以下:
watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvY2h4MTAwNTE0MTM=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="">
watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvY2h4MTAwNTE0MTM=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="">
三:代码:
样式:
.file2 {
position: absolute;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";/*ie 8*/
filter: alpha(opacity=0);/*ie 5-7*/
opacity:.0;/*opera9.0+,firefox1.5+,safari,chrome*/
width: 30px;
height: 20px;
line-height: 20px;
cursor: pointer;
padding: 0;
overflow: hidden;
padding-top: 0px;
}
<pre class="html" name="code"><em style="width:30px; height:20px; line-height:20px;overflow:hidden; font-style:normal;">
<input type="file" class="file2" id="filep_${item.DM}" style="border:none;" onchange="upload(this,'${item.DM}');" />
<a href="javascript:void(0)" >上传</a>
</em>
<font style="color: gray;">删除</font>