html选择⽂件⽤按钮,html点击button弹出挑选⽂件,上传,这个
怎么实现?
这个样式挺漂亮的,你可以试下:
!DOCTYPE html
html
head
meta http-equiv=Content-Type content=text/html; charset=utf-8 /
title定义input type=file 的样式/title
html如何下载
style type=text/css
body{ font-size:14px;}
input{ vertical-align:middle; margin:0; padding:0}
.
file-box{ position:relative;width:340px}
.txt{ height:22px; border:1px solid #cdcdcd; width:180px;}
.btn{ background-color:#FFF; border:1px solid #CDCDCD;height:24px; width:70px;}
.file{ position:absolute; top:0; right:80px; height:24px; filter:alpha(opacity:0);opacity: 0;width:260px }
/style
/head
body
div class=file-box
form action= method=post enctype=multipart/form-data
input type='text' name='textfield' id='textfield' class='txt' /
input type='button' class='btn' value='浏览...' /
input type=file name=fileField class=file id=fileField size=28
οElementById('textfield').value=this.value /
input type=submit name=submit class=btn value=上传 /
/form
/div
/body
/html
取消
评论