How to style an Input file? [duplicate]

-5
   <input type="file" accept="image/*"   class="file-input"/>
    
asked by luis 13.09.2016 в 19:33
source

1 answer

0

.file-input {
  visibility: hidden;
  width: 0;
  position: relative;
}
.file-input::before {
  content: 'Select some files';
  display: inline-block;
  background: -webkit-linear-gradient(top, #f9f9f9, #e3e3e3);
  border: 1px solid #999;
  border-radius: 3px;
  padding: 5px 8px;
  outline: none;
  white-space: nowrap;
  -webkit-user-select: none;
  cursor: pointer;
  text-shadow: 1px 1px #fff;
  font-weight: 700;
  font-size: 10pt;
  visibility: visible;
  position: absolute;
}
.file-input:hover::before {
  border-color: black;
}
.file-input:active::before {
  background: -webkit-linear-gradient(top, #e3e3e3, #f9f9f9);
}
'''
   <input type="file" accept="image/*"   class="file-input"/>
    
answered by 13.09.2016 / 19:34
source