网站:
JavaEye
作者:
ice-cream
链接:
http://ice-cream.javaeye.com/blog/160559
发表时间: 2008年01月30日
声明:本文系JavaEye网站发布的原创博客文章,未经作者书面许可,严禁任何网站转载本文,否则必将追究法律责任!
当type="file"时,input框右侧的browse按钮可以换成图片:
<style>
div {width:350px;position:relative;}
.file {position:absolute;top:0px;right:350px;+top:0;+right:45px;width:0px;height:25px;float:left; filter:alpha(opacity=0);-moz-opacity:0;opacity:0;}
.txt {width:200px;height:25px;margin-right:5px;float:left;}
.btn {width:122px;height:32px;margin-top:0px;float:left;}
</style>
<div>
<form method="post">
<input type="text" name="txt" class="txt" />
<input type="image" src="http://ice-cream.javaeye.com/upload/picture/pic/7511/36d6ffa2-1393-34af-9cf8-4e052a4b055a.gif?1201681519" class="btn"/>
<input type="file" onchange="txt.value=this.value" size="35" class="file" />
</form>
</div>
本文的讨论也很精彩,浏览讨论>>
JavaEye推荐
中国领先的电子商务网站-淘宝网招贤纳士,诚聘Java工程师