Borders disappear in Chrome when I zoom in

后端 未结 7 1810
孤街浪徒
孤街浪徒 2020-11-28 12:36

I have this really simple form: http://jsfiddle.net/TKb6M/91/. Sometimes, when I zoom in or out using Chrome, the input borders disappear. For example, when I zoom to 90% I

7条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-28 13:07

    You are forcing Chrome to do subpixel calculation, and this usually has strange behaviours.

    If you change the height of the input to 30px, then a 90% zoom works ok (because this is 27px), but a zoom of 75% not (because this is 22.50 px).

    You can also avoid this by giving the border a width of 3px. In this case, you will see that the borders width is different in different places .

    Anyway, the very best solution is to give more space around the inputs so that the border can be drawn cleanly even if it is in a subpixel position.

提交回复
热议问题