__

一般的选择框在美化过程中会出现各种问题,样式出错,文字无法更改等...

所有随之而生的便是这样的一种修饰方式:[将type=file的input与另一个按钮通过js绑定,这样便可以通过改变另一个按钮的样式来达到美化的效果了。

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<style>
.dif{
height:40px;background:#f5f8fa;border:none;border-radius:30px;
}
</style>
</head>
<body>
<input type="file"style="display:none" >
<button class="dif" onclick="F_Open_dialog()">上传文件</button>
</body>
<script type="text/javascript">
function F_Open_dialog() {
document.getElementById("btn_file").click();
}
</script>
</html>

input[type=file]的美化的更多相关文章

  1. css input[type=file] 样式美化,input上传按钮美化

    css input[type=file] 样式美化,input上传按钮美化 参考:http://www.haorooms.com/post/css_input_uploadmh

  2. input[type='file']样式美化及实现图片预览

    前言 上传图片是常见的需求,多使用input标签.本文主要介绍 input标签的样式美化 和 实现图片预览. 用到的知识点有: 1.input标签的使用 2.filelist对象 和 file对象 3 ...

  3. 文件上传input type="file"样式美化

    <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content ...

  4. 文件上传按钮input[type="file"]按钮美化时在IE8中的bug【兼容至IE8】

    首先看一下完成后的效果,鼠标移入可改变为手指的效果. 在此就不加图标了 <label class="file-upload"> <span>上传附件< ...

  5. input[type=file] 样式美化,input上传按钮美化

    <style>.file { position: relative; display: inline-block; background: #D0EEFF; border: 1px sol ...

  6. input type=file美化

    最近碰到input type=file 之前用模拟点击来实现美化,发现在IE7下会有bug导致图片上传不上去,最后改用直接美化的方法 <!DOCTYPE html> <html la ...

  7. input type=file 上传文件样式美化(转载)

    input type=file 上传文件样式美化 来源:https://www.jianshu.com/p/6390595e5a36 在做input文本上传时,由于html原生的上传按钮比较丑,需要对 ...

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

    相信做前端的都知道了,input[type=file]和其他输入标签不一样,它的事件必须是在触发自身元素上,而不能是其他元素.所以不能简单的把input隐藏,放个button上去. <a hre ...

  9. 【原创】js中input type=file的一些问题

    1.介绍 在开发中,文件上传必不可少,input[type=file] 是常用的上传标签,但是它长得又丑.浏览的字样不能换,但是他长得到底有多丑呢.我们来看看在不同浏览器里的样子吧. <inpu ...

随机推荐

  1. python 1-100的数相加的和

    count = 1 sum = 0 while count <= 100: sum = sum + count count = count + 1 print(sum) 解释: count表示计 ...

  2. UML作业第三次:分析《书店图书销售管理系统,绘制类图

    plantuml类图绘制方法的学习: 1.关于类图的学习: 类图显示了系统的静态结构. 类:类图中的主要元素,用矩形表示.矩形的上层表示类名.中层表示属性.下层表示方法. 类之间的关系:关联.依赖.聚 ...

  3. (转)Jmeter基础之编写HTTP接口用例

    使用Jmeter书写一个接口用例 第一:添加线程组 一.添加一个线程组,方法如下图所示: 二.配置线程组,如下图图所示: 需要填写名称,按需要修改线程数.等待时间和循环次数等:  第二:添加http请 ...

  4. 装PIL库

    pip install Pillow -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com

  5. springMVC--annotation

    一 解析类 ComponentScanBeanDefinitionParser component-scan标签解析类 component-scan 兼容 annotation-config ,因此前 ...

  6. leetcode网学习笔记(1)

    https://leetcode-cn.com/problems/reverse-linked-list/submissions/ 206 反转链表 错误原因:没有考虑到链表为空以及链表只有一个元素的 ...

  7. java-redis

    pom.xml添加如下配置: <dependency> <groupId>org.springframework.boot</groupId> <artifa ...

  8. cocos dos命令

  9. ajax的网上解析

    /* 用XMLHTTPRequest来进行ajax异步数据交交互*/ 主要有几个步骤: //1.创建XMLHTTPRequest对象 //最复杂的一步 if (window.XMLHttpReques ...

  10. Linux基础篇

    Linux入门 2.1 Linux介绍 1)Linux是一款操作系统,特点:免费.开源.安全.高效.稳定.处理高并发非常强悍,半年至一年重启一次机即可,比Windows强悍,现在很多企业级项目都部署到 ...