有兄弟问我修改美化文件域(input type=file)在FF下的样式,暂时没看兼容.也没美化.等到了上海安定好了再好好修改下
<!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=gb2312" />
<meta name="keywords" content="程让,练习">
<meta name="description" content="程让个人站">
<style>
input{border:1px solid #ff9900;}
div {width:300px;position:relative;}
p {float:left}
.file {position:absolute;top:20px;right:300px;+top:0;+right:73px;width:0px;height:30px;filter:alpha(opacity=0);-moz-opacity:0;opacity:0;}
#txt {height:20px;margin:1px}
#ii {width:70px;height:24px;margin-top:1px;+margin-top:2px;_margin-top:2px;}
</style>
</head>
<body>
<div>
<form method="post" action="" enctype="multipart/form-data">
<p>
<input type="text" id="txt" name="txt" />
</p>
<p>
<input id="ii" type="button" value="请选择文件" />
</p>
<p>
<input type="file" onchange="txt.value=this.value" class="file" />
</p>
</form>
</div>
</body>
</html>
提示:你可以先修改部分代码再运行。