HTML5, Placeholder, line-height in Webkit

后端 未结 4 805
小鲜肉
小鲜肉 2021-02-19 02:27

I have an input field:


with styles:

input {
    margin: 0;
    padding: 0         


        
4条回答
  •  佛祖请我去吃肉
    2021-02-19 02:41

    I don't think I can fully replicate your problem, but perhaps you can fix it using padding: 7px 6px;. Doing this should hopefully set your top and bottom padding to 7px which pretty much does a similar job as line-height. With different sizes (width/font-size) you should be able to choose the appropriate padding by calculating (height - fontsize) / 2 perhaps give or take a pixel or two for perfection.

提交回复
热议问题