自定义<input type="file">样式1
2013-11-27 00:00
513 查看
<div class="u-upload">
<button type="button">上传文件</button>
<input type="file"/>
</div>
<span class="u-upload">
<button type="button">上传文件</button>
<input type="file"/>
</span>
<a href="#" class="u-upload">
<button type="button">上传文件</button>
<input type="file"/>
</a>
<a href="#" class="u-upload">
<button type="button">上传</button>
<input type="file"/>
</a>
<style type="text/css">
/* 定制文件上传按钮 */
.u-upload{display:inline-block;*display:inline;*zoom:1;position:relative;overflow:hidden;}
.u-upload button{height:32px;padding:0 10px;border:1px solid #ccc;overflow:visible;font-size:14px;color:#666;background:#ddd;}
.u-upload input{position:absolute;top:0;right:-1px;font-size:100px;cursor:pointer;opacity:0;filter:alpha(opacity=0);}
.u-upload:hover button{border-color:#bbb;color:#333;background:#ccc;}
a.u-upload,a.u-upload:hover{text-decoration:none;}
</style>
<button type="button">上传文件</button>
<input type="file"/>
</div>
<span class="u-upload">
<button type="button">上传文件</button>
<input type="file"/>
</span>
<a href="#" class="u-upload">
<button type="button">上传文件</button>
<input type="file"/>
</a>
<a href="#" class="u-upload">
<button type="button">上传</button>
<input type="file"/>
</a>
<style type="text/css">
/* 定制文件上传按钮 */
.u-upload{display:inline-block;*display:inline;*zoom:1;position:relative;overflow:hidden;}
.u-upload button{height:32px;padding:0 10px;border:1px solid #ccc;overflow:visible;font-size:14px;color:#666;background:#ddd;}
.u-upload input{position:absolute;top:0;right:-1px;font-size:100px;cursor:pointer;opacity:0;filter:alpha(opacity=0);}
.u-upload:hover button{border-color:#bbb;color:#333;background:#ccc;}
a.u-upload,a.u-upload:hover{text-decoration:none;}
</style>
相关文章推荐
- 自定义<input type="file">样式2
- 更改上传文件的样式<input type="file>
- 关于<input type="file">样式的美化
- <input type="file">中怎设置按钮的样式
- `<input type="file">`的样式重置问题
- <input type="file">自定义样式3
- html中,文件上传时使用的<input type="file">的样式自定义
- html的文件控件<input type="file">样式的改变
- 自定义 <input type="file" /> 样式
- <input type="file">定义样式并获取上传文件路径及指定文件类型
- <input type="file">定义样式并获取上传文件路径及指定文件类型
- 设置<input type="file">的默认样式
- <input type="file">更改 页面显示 浏览 为上传 .
- IE11也不再支持document.createElement("<input type='file' name='upload'/>");
- <input type="file" name="filePath" />最简单的解决方法
- angularjs上传 和 <input type="file">与ng-model 的玩法
- <input type="file">设置的onchange只能执行一次的解决方案
- 将通过<input type="file">上传的txt文件存储在localStorage,提取并构建File对象
- 上传图片即时显示<input type="file" />(兼容所有浏览器)
- <input type="file"/>实现图片预览