Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Override default font-size of password inputs in Chrome to match Firefox

Chrome renders passwords smaller than Firefox. If I manually increase the font-size of a password input element in Chrome to match Firefox, then the caret height will be increased too, which I don't want. What's the workaround to this?

like image 396
Mark13426 Avatar asked Dec 05 '25 18:12

Mark13426


1 Answers

Here you go (using a media query to select Chrome... and Safari, which I don't have to check):

<input type="password" class="pass" value="dfjlfsdkljf"><br>
<input type="password" value="dfjlfsdkljf">​

@media screen and (-webkit-min-device-pixel-ratio:0) {
    .pass {
        -webkit-text-stroke-width: .2em;
        letter-spacing: 0.2em;
    }
}​

http://jsfiddle.net/exbFb/3/

And a blanket selector, to affect a input[type=password] elements:

@media screen and (-webkit-min-device-pixel-ratio:0) {
    input[type=password] {
        -webkit-text-stroke-width: .2em;
        letter-spacing: 0.2em;
    }
}​

http://jsfiddle.net/exbFb/4/

like image 185
Jared Farrish Avatar answered Dec 07 '25 08:12

Jared Farrish



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!