Skip to content

Instantly share code, notes, and snippets.

@huobazi
Forked from sofish/cfile.html
Created August 9, 2011 02:08
Show Gist options
  • Save huobazi/1133274 to your computer and use it in GitHub Desktop.
Save huobazi/1133274 to your computer and use it in GitHub Desktop.
customize input
<!Doctype html>
<html>
<head>
<meta charset="UTF-8" />
<title>Customize input:file</title>
<style>
.sl-custom-file{position:relative;display:inline-block;zoom:1;cursor:pointer;overflow:hidden;vertical-align:middle;}
.sl-custom-file .ui-input-file{position:absolute;right:0;top:0;_font-size:100px;_font-size:12px;_zoom:30;font-size:300px\9;height:100%;_height:auto;opacity:0;filter:alpha(opacity=0);-ms-filter:"alpha(opacity=0)";cursor:pointer;}
</style>
</head>
<body>
<span class="sl-custom-file">
<input type="button" value="点击上传文件" />
<input type="file" />
</span>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment