主要思想就是用一层遮罩input file 的位置,实现样式的统一。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
<form>
<input name="upload" type="file" style="width:200px;position:absolute;opacity:0;filter:alpha(opacity=0);" οnchange="this.form.inputs.value=this.value.substr(this.value.lastIndexOf('\\')+1);"/>
<input name="inputs" type="input" style="width:121px; height:14px;" /> <input name="" type="button" value="浏览..." style="width:70px; height:20px; border:1px solid #003c74;"/>
</form>
</body>
</html>
转自:http://blog.csdn.net/sdaiweiy/article/details/7672570