How can I remove the styles from the pseudo element -internal-input-suggested?

♀尐吖头ヾ 提交于 2021-02-18 12:33:04

问题


As of the version 76.0.3809.100 of Google Chrome, I have a new pseudo element to autocomplete the inputs. I want the autocomplete function but I need remove the styles by default.

<div pseudo="-internal-input-suggested" id="placeholder" style="display: block 
 !important;">
    myEMail@gmail.com
</div>

Styles applied by default on Chrome:

input::-internal-input-suggested, textarea::-internal-input-suggested {
    font: 400 13.3333px Arial !important;
}

I'm trying overwrite with the same input::-internal-input-suggested, textarea::-internal-input-suggested on my css but I can not.


回答1:


Carlos. This is Chrome bug #991157, #953689 with status WontFix.

The workaround I found is using :-webkit-autofill and :-webkit-autofill:first-line

input:-webkit-autofill,
input:-webkit-autofill:first-line {
    font-size: initial;
    line-height: inherit;
    /* font-family: font name; */
}


来源:https://stackoverflow.com/questions/57551530/how-can-i-remove-the-styles-from-the-pseudo-element-internal-input-suggested

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!