首页 > Web开发 > 详细

html input[type=file] css样式美化【转藏】

时间:2015-07-15 22:28:56      阅读:571      评论:0      收藏:0      [点我收藏+]

相信做前端的都知道了,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
}
View Code

 

 

 

原文出处:http://qianduanblog.com/post/css-learning-3-html-input-type-file-css-beautify.html

html input[type=file] css样式美化【转藏】

原文:http://www.cnblogs.com/zxyun/p/4649526.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!