Extra space under textarea, differs along browsers

前端 未结 2 773
既然无缘
既然无缘 2020-12-02 07:37

There`s some extra space under textarea tag. From 1 to 4 pixels in different browsers. The markup is very simple:



        
相关标签:
2条回答
  • 2020-12-02 07:53

    In my case, thirtydot's answer didn't work well with the parent <div>'s bottom border.

    display: block suited me nicely though.

    0 讨论(0)
  • 2020-12-02 08:13

    Add vertical-align: top to textarea.

    The reason for the gap is that textarea is an inline (or inline-block) element, and the gap is the space reserved for descenders in text. I don't know exactly why the gap is different between different browsers.

    0 讨论(0)
提交回复
热议问题