file CSS控制 隱藏file框,圖示觸發事件
阿新 • • 發佈:2019-02-11
<!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" />
<style type="text/css">
.file{
width:300px;height:80px;
position:relative;
}
.file_file{
width:10px;
filter:alpha(opacity=0);
opacity:0;
position:absolute;left:0px;top:0px;
z-index:10;
}
.file_button{
width:50px;height:22px;
position:absolute; top:0px;
z-index:1;
curs
}
</style>
</head><body>
<form id="form1" name="form1" enctype="multipart/form-data" method="post" action="1.php">
<div class='file'>
<div style="width:10px;">
<input type="file" class="file_file" id="file" onchange="setValue()"/>
<div class="file_button"><img src="bj.png" id='file_txt' /></div>
</div>
</div>
</form>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
.file{
width:300px;height:80px;
position:relative;
}
.file_file{
width:10px;
filter:alpha(opacity=0);
opacity:0;
position:absolute;left:0px;top:0px;
z-index:10;
}
.file_button{
width:50px;height:22px;
position:absolute; top:0px;
z-index:1;
curs
}
</style>
</head><body>
<form id="form1" name="form1" enctype="multipart/form-data" method="post" action="1.php">
<div class='file'>
<div style="width:10px;">
<input type="file" class="file_file" id="file" onchange="setValue()"/>
<div class="file_button"><img src="bj.png" id='file_txt' /></div>
</div>
</div>
</form>
</body>
</html>