修改 文件上传 默认样式
2016-07-05 13:02
453 查看
jsp:
<h3>选择文件导入 :</h3></strong><br/> <form action="${base}/yellowPage01/leadin/lot/save" method="post" enctype="multipart/form-data" > <a class="a-upload"> <input type="file" name="file" id="file">点击这里上传文件 </a><span id="showFileName" class="b-upload" ></span> <div class="form-button" ><br/> <button id="submit_edit2" class="button bg-main">批量导入</button> </div> </form> css:<style type="text/css"> .a-upload { padding: 4px 10px; height: 30px; line-height: 20px; position: relative; cursor: pointer; color:#fff ; background: #0ae; border-color: #0ae; border-radius: 4px; overflow: hidden; display: inline-block; *display: inline; *zoom: 1 } .b-upload { padding:4px ; height: 30px; line-height: 20px; position: relative; cursor: pointer; 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: #fff; background: #0ae; border-color: #0ae; text-decoration: none } </style> js:$(".a-upload").on("change","input[type='file']",function(){ var filePath=$(this).val(); var arr=filePath.split('//'); var fileName=arr[arr.length-1]; $("#showFileName").html(fileName); });
相关文章推荐
- css3 box-sizing属性
- css 一些灵动性的小方法
- CSS实现垂直居中水平居中的绝对定位居中技术
- CSS深入理解vertical-align和line-height的基友关系
- CSS-行内框、行框、行高
- CSS中设置DIV垂直居中的N种方法 兼容IE浏览器
- web iphone css 兼容性
- CSS3 transition 属性
- CSS滤镜(Filters)
- CSS3 Flexbox布局
- css 设置字体
- JQ添加移除css样式
- 关于display inline-block的对齐问题
- 为导航栏创建下拉菜单
- CSS的三种使用方法。 行内样式: 内嵌式: 外部式:
- css 选择器 有待练习
- css 注意点
- css 选择器
- CSS3图片缩放
- 移动web适配利器-rem In CSS3