我做了一些研究,发现很难设计输入类型=文件的样式。然而,我意识到当您想要将视频上传到该网站时,YouTube 会显示一个漂亮的按钮。 (可能需要登录:http://www.youtube.com/upload http://www.youtube.com/upload).
所以基本上它允许用户单击按钮,选择一个文件,然后上传。
我不知道这是如何实现的,而不是使用丑陋的<input>
标签?或者有人知道有什么好的方法可以制作一个漂亮的文件上传界面吗?
现场演示 http://jsbin.com/ehEqUGU/2/edit
<button id="imageDrop" onclick="document.getElementById('uploadImage').click()" title="Click or Drag Image">Upload image</button>
<input id="uploadImage" type="file" />
#imageDrop{
background:#fff;
width:300px;
height:180px;
font-size:20px;
font-style:italic;
border-radius:18px;
border:2px dashed #444;
}
#uploadImage{
visibility: hidden;
height:0px;
width: 0px;
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)