Is it possible to change the appearance of <input type="file">
?
相关问题
- Views base64 encoded blob in HTML with PHP
- Is there a way to play audio on a mobile browser w
- HTML form is not sending $_POST values
- implementing html5 drag and drop photos with knock
- Adding a timeout to a render function in ReactJS
Here is one way which I like because it makes the input fill out the whole container. The trick is the "font-size: 100px", and it need to go with the "overflow: hidden" and the relative position.
Something like that maybe?
to show path of selected file you can try this on html :
and in javascript :
and style :
The trick is hide the input and customize the label.
HTML:
CSS:
JS:
You can check this example: https://jsfiddle.net/rjurado/hnf0zhy1/4/
Bootstrap example
Here is one way I recently discovered, with a bit of jQuery
HTML Code:
For the javascript/jQuery part :
In this example, I have put an "anchor" tag to trigger the file upload. You can replace with anything you want, just remember to put the "onclick" attribute with the proper function.
Hope this helps!
P.S. : Do not forget to include jQuery from CDN or any other source