0

I need to change the color of the browse button when the input type is type="file".I've created a js fiddle for this which works fine in chrome.But the color is not getting changed in IE.Please help. Here's the link to it:http://jsfiddle.net/E42XA/596/

HTML:

 <form>    
    <input type="file" id="fileUpload">
    </form>

CSS:

 input, label {
    display: block;
    }
input[type="file"] {    
  border:none !important;
    background-image:none;
    cursor: pointer;
}

input[type=file]::-webkit-file-upload-button {
    border: none;
  margin: 0;
  padding: 0;
  -webkit-appearance: button;
  width: 100px;
 background-color:#003b5c !important;
  color:#fff;
  cursor: pointer;
}
<!--[if IE]>
<style type="text/css">
input.hide
{
    position:absolute;
    let:10px;
    -moz-opacity:0;
    filter:alpha(opacity:0);
    opacity:0;
    z-index:2;
    width:0px;
    border-width:0px;
    background-color:#003c5c !important;
}
</style>
<![endif]-->
ashok
  • 1
  • Styling the input type file is mostly not support cf. http://stackoverflow.com/questions/572768/styling-an-input-type-file-button – Stephan Köninger Apr 14 '17 at 20:14
  • Conditional comments are no longer supported by the current version of IE, so which version of IE are we talking about here? – Mr Lister Apr 14 '17 at 20:16
  • @MrLister I'm currently using IE 10.I need to fix this issue for both IE 10 and 11.. – ashok Apr 15 '17 at 01:20
  • your example has been copied from http://www.nullskull.com/q/10324683/how-to-change-color-of-browse-button-in--fileupload-control.aspx. – Rob Parsons Apr 16 '17 at 00:07

0 Answers0