keep placeholder on focus in IE10

前端 未结 7 1309
Happy的楠姐
Happy的楠姐 2020-11-30 05:42

Under WebKit and Firefox, the text in a input\'s placeholder sticks around on focus—it doesn\'t disappear until input.val

7条回答
  •  刺人心
    刺人心 (楼主)
    2020-11-30 06:06

    I Googled around a bit, and found that there are some CSS pseudo-elements and pseudo-classes that can be used to style placeholders.

    input:-ms-input-placeholder:focus{
        color: #999;
    }
    

    See this answer for more info: https://stackoverflow.com/a/2610741

提交回复
热议问题