我刚刚注意到文本区域下方有一些连线间距,每个浏览器都不同。有人可以解释为什么它在那里吗?
span,
textarea {
border: 1px solid black;
margin: 0;
padding: 0;
}
<textarea></textarea>
<span>test</span>
最佳答案
添加
vertical-align:bottom
这是因为
The baseline of some replaced elements, like
<textarea>
, is not specified by the HTML specification, meaning that their behavior with this keyword may change from one browser to the other.
span,
textarea {
border: 1px solid black;
margin: 0;
padding: 0;
vertical-align: bottom;
}
<textarea></textarea>
<span>test</span>
关于html - 文本区域无法解释的间距,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46447431/