Ver Mensaje Individual
  #2 (permalink)  
Antiguo 28/05/2015, 13:05
Avatar de jolijun
jolijun
 
Fecha de Ingreso: mayo-2015
Mensajes: 19
Antigüedad: 9 años
Puntos: 4
Respuesta: Como reemplazar input file con imagen

Te dejo el ejemplo que hice en jsfiddle: https://jsfiddle.net/nhfggdva/

Código HTML:
Ver original
  1. <div class="input-file">
  2.     <label for="file1"></label>
  3.     <input id="file1" type="file" />
  4. </div>

Código CSS:
Ver original
  1. .input-file {
  2.      width: 200px;
  3.      height: 200px;    
  4. }
  5.  
  6. .input-file label {
  7.      width: 100%;
  8.      height: 100%;
  9.      display: block;
  10.      background: transparent url(http://vignette4.wikia.nocookie.net/fable/images/5/53/Image_Upload.png/revision/latest?cb=20101002231116) no-repeat center center;
  11. }
  12.  
  13. .input-file input[type=file] {
  14.     display: block;
  15.     width: 100%;
  16.     height: 100%;
  17.     opacity: 0;
  18. }

Última edición por jolijun; 28/05/2015 a las 13:10