Html
    Css
    Js
* {
	margin:0;
	padding:0;
	text-decoration:none;
	font-size:14px;
}
.main {
	width:510px;
	margin:0 auto;
}
.file-btn {
	position:relative;
	margin:20px 0
}
.file-btn .input-btn {
	display:inline-block;
	width:150px;
	text-align:center;
	height:30px;
	line-height:30px;
	color:#fff;
	background-color:#00a0e9;
	border:1px solid #ccc;
}
.file-btn .file {
	position:absolute;
	width:150px;
	height:30px;
	display:block;
	left:0px;
	top:0px;
	opacity:0.01;
	cursor:pointer;
}
.imgWrap {
	border:1px solid #ccc;
	height:300px;
	width:500px;
	overflow:visible;
}
.imgWrap img {
	width:100%;
}

                        
↑上面代码改变,会自动显示代码结果 jQuery调用版本:1.10.2
 立即下载

html5 fileReader图片上传

0