Skip to content

Instantly share code, notes, and snippets.

@dtaniwaki
Last active August 29, 2015 13:56
Show Gist options
  • Save dtaniwaki/9015023 to your computer and use it in GitHub Desktop.
Save dtaniwaki/9015023 to your computer and use it in GitHub Desktop.
/*
* Wrap file input like this.
* <span class="file-wrapper">
* <span class="class-for-your-custom-button">Choose a Photo</span>
* <input type="file" name="photo" id="photo" />
* </span>
*/
.file-wrapper {
cursor: pointer;
overflow: hidden;
position: relative;
display: inline-block;
vertical-align: baseline;
zoom: 1;
*display: inline;
*vertical-align: auto;
}
.file-wrapper input {
cursor: pointer;
font-size: 100px;
height: 100%;
filter: alpha(opacity=1);
-moz-opacity: 0.01;
opacity: 0.01;
position: absolute;
right: 0;
top: 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment