点击图片就可以完成上传功能
2016-04-20 16:30
543 查看
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>点击图片上传功能测试</title>
<style type="text/css">
.maleIdOfImageBackView{
height:256px;
width: 256px;
background:url('images/01.jpg');/*图片路径根据具体情况可更改*/
position:relative;
}
.maleFileInputBackView{
height:256px;
font-size: 300px;
position:absolute;
right:0;
top:0;
opacity: 0;
filter:alpha(opacity=0);
cursor:pointer;
}
</style>
</head>
<body>
<div class="maleIdOfImageBackView">
<input class="maleFileInputBackView" type="file" name="" id="" />
</div>
</body>
</html>
代码可直接复制亲测!
实现原理是:用图片盖住input上传文件类型控件!
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>点击图片上传功能测试</title>
<style type="text/css">
.maleIdOfImageBackView{
height:256px;
width: 256px;
background:url('images/01.jpg');/*图片路径根据具体情况可更改*/
position:relative;
}
.maleFileInputBackView{
height:256px;
font-size: 300px;
position:absolute;
right:0;
top:0;
opacity: 0;
filter:alpha(opacity=0);
cursor:pointer;
}
</style>
</head>
<body>
<div class="maleIdOfImageBackView">
<input class="maleFileInputBackView" type="file" name="" id="" />
</div>
</body>
</html>
代码可直接复制亲测!
实现原理是:用图片盖住input上传文件类型控件!
相关文章推荐
- WEB前端开发人员须知的常见浏览器兼容问题及解决技巧
- Linux下gcc 优化等级的介绍
- python3.4+django1.9+mysql5.6环境之hello world
- 探索scrollView的实现*复用
- win8.1+vs2013环境编译tiff-3.8.2
- C++11 语法 struct : bar{} foo{}
- Spring 注解 javax.annotation.Resource和@Autowired
- Object 源码分析
- 升级10.11后使用CocoaPod出现-bash: pod: command not found 解决办法
- 用户场景描述
- Zookeeper安装部署
- mysql修改列的类型
- Spring整合CXF,发布RSETful 风格WebService
- JSTL(fn函数)
- Unity Shader 闪光特效
- Android按两次返回键退出
- 初识安卓基本控件_tablelayout
- MySQL添加用户、删除用户与授权
- mybatis批量更新
- mysql 源码安装