Pure CSS restyling of file upload button

use css only to restyle a file upload button

by Peter Drinnan

HTML

<input type="file" class="form-control">

CSS

.form-control {
    display: block;
    width: 100%;
    height: 34px;
    padding: 6px 12px;
    font-size: 14px;
    line-height: 1.42857143;
    color: #555;
    background-color: #fff;
    background-image: none;
    border: 1px solid #ccc;
    border-radius: 2px;
    -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,0.075);
    box-shadow: inset 0 1px 1px rgba(0,0,0,0.075);
    -webkit-transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s;
    -o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
    transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
}


::-webkit-file-upload-button {
  color: black;
  background-color: #2196f3;
  font-family: 'Lato', sans-serif;
  text-transform: uppercase;
  border: 0;
  border-radius: 2px;
  font-size: 12px;
  line-height: 32px;
  height: 32px;
  font-weight: normal;
  text-align: center;
  vertical-align: middle;
  cursor: pointer;
  white-space: nowrap;
  padding: 0 12px;
}

/* for poor sods using IE */
::-ms-browse {
color: black;
  background-color: #2196f3;
  font-family: 'Lato', sans-serif;
  text-transform: uppercase;
  border: 0;
  border-radius: 2px;
  font-size: 12px;
  line-height: 32px;
  height: 32px;
  font-weight: normal;
  text-align: center;
  vertical-align: middle;
  cursor: pointer;
  white-space: nowrap;
  padding: 0 12px;
}