Created
June 10, 2015 04:08
-
-
Save smunchi/3c24798f795dc477c68c to your computer and use it in GitHub Desktop.
position or display file input with custom style or text
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <form method="POST" action="myurl"> | |
| <span class="btn btn-success fileinput-button"> | |
| <span>Select file</span> | |
| <input type="file" name="file"/> | |
| </span> | |
| </form> | |
| /*Copied from bootstrap */ | |
| .btn { | |
| display: inline-block; | |
| padding: 6px 12px; | |
| margin-bottom: 0; | |
| font-size: 14px; | |
| font-weight: normal; | |
| line-height: 1.42857143; | |
| text-align: center; | |
| white-space: nowrap; | |
| vertical-align: middle; | |
| cursor: pointer; | |
| -webkit-user-select: none; | |
| -moz-user-select: none; | |
| -ms-user-select: none; | |
| user-select: none; | |
| background-image: none; | |
| border: 1px solid transparent; | |
| border-radius: 4px; | |
| } | |
| /*Also */ | |
| .btn-success { | |
| color: #fff; | |
| background-color: #5cb85c; | |
| border-color: #4cae4c; | |
| } | |
| /* This is copied from https://github.com/blueimp/jQuery-File-Upload/blob/master/css/jquery.fileupload.css */ | |
| .fileinput-button { | |
| position: relative; | |
| overflow: hidden; | |
| } | |
| /*Also*/ | |
| .fileinput-button input { | |
| position: absolute; | |
| top: 0; | |
| right: 0; | |
| margin: 0; | |
| opacity: 0; | |
| -ms-filter:'alpha(opacity=0)'; | |
| font-size: 200px; | |
| direction: ltr; | |
| cursor: pointer; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment