设置input file的样式
来源:互联网 发布:软件开发是什么 编辑:程序博客网 时间:2024/04/29 19:27
原理:
通过三个input代替一个input file的样式.
代码:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>定义input type="file" 的样式</title>
<style type="text/css">
body{ font-size:14px;}
input{ vertical-align:middle; margin:0; padding:0}
.file-box{ position:relative;width:340px}
.txt{ height:22px; border:1px solid #cdcdcd; width:180px;}
.btn{ background-color:#FFF; border:1px solid #CDCDCD;height:24px; width:70px;}
.file{ position:absolute; top:0; right:80px; height:24px; filter:alpha(opacity:0);opacity: 0;width:260px }
</style>
</head>
<body>
<div class="file-box">
<form action="" method="post" enctype="multipart/form-data">
<input type='text' name='textfield' id='textfield' class='txt' />
<input type='button' class='btn' value='浏览...' />
<input type="file" name="fileField" class="file" id="fileField" size="28" onchange="document.getElementById('textfield').value=this.value" />
<input type="submit" name="submit" class="btn" value="上传" />
</form>
</div>
</body>
</html>
通过三个input代替一个input file的样式.
代码:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>定义input type="file" 的样式</title>
<style type="text/css">
body{ font-size:14px;}
input{ vertical-align:middle; margin:0; padding:0}
.file-box{ position:relative;width:340px}
.txt{ height:22px; border:1px solid #cdcdcd; width:180px;}
.btn{ background-color:#FFF; border:1px solid #CDCDCD;height:24px; width:70px;}
.file{ position:absolute; top:0; right:80px; height:24px; filter:alpha(opacity:0);opacity: 0;width:260px }
</style>
</head>
<body>
<div class="file-box">
<form action="" method="post" enctype="multipart/form-data">
<input type='text' name='textfield' id='textfield' class='txt' />
<input type='button' class='btn' value='浏览...' />
<input type="file" name="fileField" class="file" id="fileField" size="28" onchange="document.getElementById('textfield').value=this.value" />
<input type="submit" name="submit" class="btn" value="上传" />
</form>
</div>
</body>
</html>
0 0
- 设置input file的样式
- input file样式设置
- input file 的样式
- <input type="file">中怎设置按钮的样式
- jsp 设置自己喜欢的input:file样式
- 设置<input type="file">的默认样式
- input的样式设置
- 修改Input File的样式
- 设置input 的 checkbox样式
- input file 的样式改变的实例
- 自定义file类型input的样式
- input type="file" 样式的模仿
- 改变input type file的默认样式
- input[type="file"]的样式修改
- 修改input元素的file样式
- 自定义input[type=”file”]的样式
- input,type="file"的样式修改
- 美化input type="file"的样式
- JAR包介绍大全用途作用详解JAVA
- 二分图匹配---- 二分的真谛
- ls -l |grep "^-"|wc -l 程序问题的定位—strace -p pid(跟踪系统调用)gdb -p pid(调试)lsof -p pid(查看当前进程打开的文件描述符) ps -e
- 字节、字、位、比特,这四者之间的关系
- Struts2 带参数跳转
- 设置input file的样式
- jsp面试题
- Java 的内存泄漏
- 操作系统知识点复习(一)
- mysql修改表、字段、库的字符集
- 获取发布后项目在服务器的绝对路径
- Linux开启mysql远程连接的设置步骤
- 网站架构网站
- Linux 6.3下安装Oracle Enterprise Cloud Control 12c