How to change font-color for disabled input?

后端 未结 10 1110
逝去的感伤
逝去的感伤 2020-12-02 12:48

I need to change the style for a disabled input element in CSS.



        
10条回答
  •  北荒
    北荒 (楼主)
    2020-12-02 13:43

    The following gets you pretty close in IE8 and works in other browsers too.

    In your html:

    
           onfocus="this.blur();" 
           tabindex="-1"          
           class="disabledInput"  
           />
    

    In your CSS:

    .disabledInput {
        color: black;
    }
    

    In IE8, there is a slight amount of border color change on hover. Some CSS for input.disabledInput:hover could probably take care of this.

提交回复
热议问题