+ -
当前位置:首页 → 问答吧 → type=file在firefox下可行,但是到了ie6下就不行了,代码如下

type=file在firefox下可行,但是到了ie6下就不行了,代码如下

时间:2011-10-06

来源:互联网

div.btn-upload {display : inline-block;background : url(/images/top/forms-file.gif) no-repeat right top transparent;}
div.btn-upload:hover {background-position : right bottom;}
div.btn-upload input {*position : relative;*z-index : -1;*margin-left:50px}
input.file {float : left;background : url(/images/top/forms-input-small.gif) no-repeat left top transparent;margin : 0 2px 0 0;z-index : 99;height : 15px;}


<div style="display: inline-block; overflow: hidden; width: auto; height: 27px;">
<input class="file" style="width:166px;">
<div class="btn-upload" style="width:65px;height:27px;margin:0pt;overflow:hidden;">
<input type="file" style="height:27px;width:166px;display:inline;cursor:pointer;opacity:0;margin-left:-168px;">
</div>
</div>


type="file"这个我用一个input class="file"这里是一个固定长度的一个text和一个图片(BROWSER)来覆盖那个type="file"来显示,主要是为了美观,代码如上。firefox下点击那个browser图片(forms-file.gif)是可以出来选择上传文件的框,但是到了ie6下就不行了。这是怎么回事啊?

作者: ktjamy   发布时间: 2011-10-06

帮自己顶一下

作者: ktjamy   发布时间: 2011-10-08

热门下载

更多