html - Remove input file button and style the files chosen -
i trying create upload form takes multiple images. want able remove "choose files" button keep "no file chosen" inform user files going uploading.
i understand can set opacity 0 on input type file styling, removes both "choose files" , "no file chosen" text.
here codepen of image uploader far.
to summarise:
- i want remove choose files button
- keep no file chosen text.
here html:
<div class="upload"> <div class="container"> <div class="row"> <div class="col-md-12"> <h1>would <span style='color: lightgreen;'>upload</span> or <span style='color: orangered;'>delete</span> file?</h1> <div style="position: relative; height: 275px;"> <form action="" method="post" enctype="multipart/form-data" class="formup"> <input type="file" name="filetoupload[]" id="filetoupload" accept="image/*" multiple="multiple"><p>click here upload images.</p></input> <input type="submit" value="upload images" name="submitupload" /> </form> </div> </div> </div> </div> </div>
here css:
.up { border: none; } .upload { padding-top: 6%; } .upload input[type='file'] { outline: none; width: 100%; height: 100%; position: absolute; } .formup { border: 4px dashed black; width: 400px; height: 200px; position: absolute; } .formup p { text-align: center; width: 100%; height: 100%; line-height: 170px; font-weight: bold; font-size: 1.5em; } .upload input[type='submit'] { margin-top: 2%; width: 100%; height: 20%; } .upload input[type='submit'] { background: #0ac986; dispaly: inline-block; width: 100%; font-size: 16px; height: 50px; color: #fff; text-decoration: none; border: none; border-radius: 4px; -moz-border-radius: 4px; -webkit-border-radius: 4px; } .upload input[type='submit']:hover { color: #f37272; background-color: palegreen; } .upload input[type='submit'] { -o-transition: .3s; -moz-transition: .3s; -webkit-transition: .3s; -ms-transition: .3s; } .upload input[type='submit']:hover { color: red; }
afaik, can't thing style input file. can using opacity , appearance trick , makes input file covering parent element, user still receive click event of input file.
also need use javascript/jquery handle need. if using javascript/jquery not problem you, below sample implementation [codepen][1].
[1]: http://codepen.io/mahdaen/pen/ejwodb
Comments
Post a Comment