CSS: Upload Button

by Jens Kühn

HTML

<form action="" method="post" enctype="multipart/form-data">
     <div class="upload">Upload
         <input type="file" name="upload"/>
     </div>
</form>

CSS

div.upload {
     width: 157px;
     height: 57px;
     background: #f00;
     overflow: hidden;
     z-index: 1;
     text-align: center;
}

div.upload input {
     display: block !important;
     position: absolute;
     top:0;
     left:0;
     width: 157px !important;
     height: 57px !important;
     opacity: 0 !important;
     overflow: hidden !important;
     background: #0f0;
     z-index:2;
}