Edge input placeholder not aligned with text

好久不见. 提交于 2019-12-24 03:34:06

问题


In all other browsers, the placeholder of my input of type text starts where the cursor is flickering. However, in Microsoft Edge, the placeholder text appears ahead of the cursor. Is there any way to fix this?

Expected result:

Edge result:


回答1:


It seems I found the answer (the sooner I asked it here...)

The problem is with the text-indent property. Somehow in Edge it moves the cursor at an inequal distance to the placeholder. Using

padding-left: 10px;

instead of

text-indent: 10px;

solves the isse. Here's a working fiddle with both scenarios: jsfiddle



来源:https://stackoverflow.com/questions/40910797/edge-input-placeholder-not-aligned-with-text

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