Skip to content

Instantly share code, notes, and snippets.

@ghernandez345
Last active December 24, 2015 12:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ghernandez345/6800694 to your computer and use it in GitHub Desktop.
Save ghernandez345/6800694 to your computer and use it in GitHub Desktop.
file upload btn snippet
<!-- The fileinput-button span is used to style the file input field as button -->
<button class="btn btn-default btn-lg upload-btn fileinput-button">
<span>Upload More Files</span>
<!-- The file input field used as target for the file upload widget -->
<input id="fileupload" type="file" name="files[]" multiple>
</button>
// file upload btn styles
.upload-btn {
position: relative;
overflow: hidden;
> input {
cursor: pointer;
direction: ltr;
filter: alpha(opacity=0);
font-size: 60px; // height of the button
margin: 0;
opacity: 0;
position: absolute;
right: 0;
transform: translate(-300px, 0) scale(4);
top: 0;
width: 100%; // take up the entire width of the button
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment