html input[type=file] css样式美化【转藏】
相信做前端的都知道了,input[type=file]和其他输入标签不一样,它的事件必须是在触发自身元素上,而不能是其他元素。所以不能简单的把input隐藏,放个button上去。
<a href="javascript:;" class="a-upload">
<input type="file" name="" id="">点击这里上传文件
</a>
/*a upload */
.a-upload {
padding: 4px 10px;
height: 20px;
line-height: 20px;
position: relative;
cursor: pointer;
color: #888;
background: #fafafa;
border: 1px solid #ddd;
border-radius: 4px;
overflow: hidden;
display: inline-block;
*display: inline;
*zoom: 1
} .a-upload input {
position: absolute;
font-size: 100px;
right: 0;
top: 0;
opacity: 0;
filter: alpha(opacity=0);
cursor: pointer
} .a-upload:hover {
color: #444;
background: #eee;
border-color: #ccc;
text-decoration: none
}
原文出处:http://qianduanblog.com/post/css-learning-3-html-input-type-file-css-beautify.html
html input[type=file] css样式美化【转藏】的更多相关文章
- 自定义input[type="file"]的样式
input[type="file"]的样式在各个浏览器中的表现不尽相同: 1. chrome: 2. firefox: 3. opera: 4. ie: 5. edge: 另外,当 ...
- input[type="file"]的样式以及文件名的显示
如何美化input[type="file"] 基本思路是: (1)首先在 input 外层套一个 div : (2)将 div 和 input 设置为一样大小(width和heig ...
- html中,文件上传时使用的<input type="file">的样式自定义
Web页面中,在需要上传文件时基本都会用到<input type="file">元素,它的默认样式: chrome下: IE下: 不管是上面哪种,样式都比较简单,和很多 ...
- html中input type=file 改变样式
<style> #uploadImg{ font-size:12px; overflow:hidden; position:absolute} #file{ position:absolu ...
- input[type='file']默认样式
<input type="file" name="" id="" value="" /> 当input的ty ...
- 对input type=file 修改样式
效果图先给: 在html中涉及到文件选择的问题,文件选择使用 input(class="filter_input form-control" type="file) 但是 ...
- input[type='file']样式美化及实现图片预览
前言 上传图片是常见的需求,多使用input标签.本文主要介绍 input标签的样式美化 和 实现图片预览. 用到的知识点有: 1.input标签的使用 2.filelist对象 和 file对象 3 ...
- 文件上传input type="file"样式美化
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content ...
- 知识点:定义input type=file 样式的方法(转)
——“当我们想要用css美化表单的时候,有两个控件就会和前段人员作对,一个是是大名鼎鼎的select,另一个就是我现在要说说的 input type=file” 为什么要美化file控件?试想一下,别 ...
随机推荐
- 转载:win7JDK环境配置
[win7JDK环境配置] 网址:http://blog.sina.com.cn/s/blog_6a9df2330100ms9q.html 系统变量下: (1) 新建->变量名:JAVA_HOM ...
- 【HDOJ】3496 Watch The Movie
二维费用背包. #include <stdio.h> #include <string.h> #define mymax(a, b) (a>b) ? a:b ][]; ] ...
- bzoj1984
树链剖分在边上的应用比维护点稍微麻烦一点,是对每条边标号,并且要记录每个点父亲边的编号和重儿子然后注意各种细节线段树上和bzoj1858的维护方法类似,覆盖的优先级高于加具体见程序,完全是为了提升状态 ...
- 【log4js】
手动创建日志目录 定时清理 nodejs之日志管理 玩转Nodejs日志管理log4js access.log-2015-11-20
- Team Foundation Server操作说明
目录 一. Visual Studio 2010团队协作管理 1.1团队模型及角色 1.1.1创建角色 1.1.2创建工作组 1.1.3工作组成员及权限 1.2团队成员利用VS2010实现协同办公 1 ...
- ASP.NET生命周期详解 [转]
最近一直在学习ASP.NET MVC的生命周期,发现ASP.NET MVC是建立在ASP.NET Framework基础之上的,所以原来对于ASP.NET WebForm中的很多处理流程,如管道事件等 ...
- ARM学习笔记8——通用寄存器和存储器内容交换指令和软中断指令
交换指令将一个存储单元内容与制定的寄存器内容相交换,交换指令为进程间同步提供了一种方便的解决途径.该指令产生一堆原子Load/Store操作,该操作发生在一个连续的总线操作中,在操作期间阻止其他任何指 ...
- Cubieboard编译安装NodeJS经验总结
Cubieboard编译安装NodeJS经验总结,以供新手免走弯路. Cubieboad用的是arm处理器,NodeJs的编译安装上不像pc上那么简单,可以一遍过. 单单make编译一次,就得几乎一个 ...
- bzoj 1069 [SCOI2007]最大土地面积(旋转卡壳)
1069: [SCOI2007]最大土地面积 Time Limit: 1 Sec Memory Limit: 162 MBSubmit: 2277 Solved: 853[Submit][Stat ...
- JavaScript高级程序设计37.pdf
用DOM范围实现简单选择 selectNode()和selectNodeContents()它们都接收一个DOM节点参数,然后使用该节点中的信息来填充范围,其中selectNode()方法选择整个节点 ...