下面是一个文件上传的样式,因为各个浏览器的默认样式不一样,所以在网上搜集了一个,写在这里方便以后使用:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<htmlxmlns="http://www.w3.org/1999/xhtml">
<head>
<style>
.opacity {opacity:0;FILTER:Alpha(Opacity=0);}
.text {border: 1px solid #c0c1b3;}
.text.opacity {position:absolute;height:20px;}
.text.file {width:129px!important;width:135px;z-index:100;}
.text.file_btn {height:19px;margin:0 0 -1px 0;width:auto!important;width:60px;background:#f0f0f0;padding:;}
</style>
</head>
<body>
<inputtype="file"name="file_0_ture"size="20"onchange="document.getElementById('file_0').value=this.value"class="text opacity">
<inputname="file_0"id="file_0"value=""class="text">
<inputtype="button"value="浏览..."class="file_btn">
</body>
</html>