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控件?试想一下,别 ...
随机推荐
- Yii modules中layout文件的调用
在YII中,如果我们使用了modules区分了前后台,那么在不同的modules中需要使用各自的layout文件,在使用中发现经常会调用不到modules中的layout,下面介绍一下如何才能正确的调 ...
- show processlist 输出ID 和 information_schema.PROCESSLIST 的id,information_schema.innodb_trx的TRX_MYSQL_T
Session 1: mysql> start transaction; Query OK, 0 rows affected (0.00 sec) mysql> update Client ...
- 【CF】3B Lorry
这道题目网上有几个题解,均有问题.其实就是简单的贪心+排序,没必要做的那么复杂.一旦tot+curv > v时,显然curv==2, 有三种可能:(1)取出最小的curv==1的pp,装入当前的 ...
- linux 下 poll 编程
poll 与 select 很类似,都是对描述符进行遍历,查看是否有描述符就绪.如果有就返回就绪文件描述符的个数将.poll 函数如下: #include <poll.h> int pol ...
- App架构经验总结(转)
原文链接: http://keeganlee.me/post/architecture/20160303 架构因人而异,不同的架构师大多会有不同的看法:架构也因项目而异,不同的项目需求不同,相应的架构 ...
- java线程(3)-多线程死锁
产生死锁的条件: 1.有至少一个资源不能共享2.至少有一个任务必须持有一个资源并且等待获取另一个被别的任务持有的资源3.资源不能任务抢占4.必须有循环等待 package com.thread; /* ...
- Away3d 基础 1 ---对一个简单类的解释
转自:http://www.cnblogs.com/nooon/archive/2009/05/16/1458334.html 原英文地址: http://www.flashmagazine.com/ ...
- 对使命召唤OL游戏中队友能相互救治的动作设定的感慨
很偶然的在网吧看到有人在玩一个枪战游戏,场景特别真实特别吸引人,后来留意到是使命召唤OL.我使用QQ帐号(是腾讯代理)玩了一次,觉得游戏做的确实精致,子弹打击效果和人物被子弹击中的效果特别真实,大家可 ...
- JavaScript高级程序设计45.pdf
客户区坐标位置 clientX和clientY保存着鼠标指针在视口中的水平位置坐标和垂直位置坐标(显示出页面的部分叫做客户区,坐标信息不包括页面的滚动距离) var div=document.getE ...
- HW4.30
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner i ...