Created
April 17, 2014 13:22
-
-
Save dkesberg/10983003 to your computer and use it in GitHub Desktop.
file input styling for bootstrap 3
This file contains 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
.btn-file { | |
position: relative; | |
overflow: hidden; | |
} | |
.btn-file input[type=file] { | |
position: absolute; | |
top: 0; | |
right: 0; | |
min-width: 100%; | |
min-height: 100%; | |
font-size: 999px; | |
text-align: right; | |
filter: alpha(opacity=0); | |
opacity: 0; | |
background: red; | |
cursor: inherit; | |
display: block; | |
} | |
input[readonly] { | |
background-color: white !important; | |
cursor: text !important; | |
} |
This file contains 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
<div class="input-group"> | |
<span class="input-group-btn"> | |
<span class="btn btn-default btn-file"> | |
Browse... | |
<input data-url="/upload" accept="image/jpeg" name="image" type="file" id="image"> | |
</span> | |
</span> | |
<input readonly="readonly" placeholder="Picture file" class="form-control" name="filename" type="text"> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment