猿问
如何将file对象的显示信息自定义?
<input type="file" />
用浏览器打开效果如图
我有什么办法将browse这几个字改为 “请立即上传文件” ?
慕哥9229398
浏览 728
回答 1
1回答
胡子哥哥
<input type="button" name="" value="请立即上传文件"><input type="file" name="files"> input[type="file"]{ opacity: 0; position: relative; top:0; left:-120px; } input[type="button"]{ width:120px; height: 35px; line-height: 35px; background-color: #fff; font-size:14px; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; }用一个按钮或者a标签或者div把其包裹起来,通过定位使其位置重合,然后将flie的原样式设置为透明度为0(opacity:0)
0
0
0
随时随地看视频
慕课网APP
相关分类
JavaScript
我要回答