Remove 3 pixels in iOS/WebKit textarea

前端 未结 7 1465
说谎
说谎 2021-02-06 23:39

I\'m trying to create a textarea that looks exactly like a div.

However, on iOS there\'s 3 pixels coming from somewhere that I can\'t remove.

7条回答
  •  栀梦
    栀梦 (楼主)
    2021-02-07 00:22

    text-intend doesn't work when having multiple lines, (as Jonathan mentioned in a comment at the accepted answer).

    So, this worked for me on iPhone 6:

    textarea {
        margin-left: -3px;
        &::placeholder {
            padding-left: 3px;
        }
    }
    

提交回复
热议问题