【发布时间】:2021-05-27 14:14:41
【问题描述】:
我有一个输入标签,当我输入输入时,在给定宽度后,文本被溢出隐藏。我真正需要的是当我输入输入时,文本转到下一行,是 可能。只输入不是文本区域。
input {
height: auto;
}
<!DOCTYPE html>
<html>
<body>
<h1>The input element</h1>
<form action="/action_page.php">
<input type="text" id="comment" name="comment" /><br/>
<input type="submit" value="Submit">
</form>
<p>Click the "Submit" button and the form-data will be sent to a page on the
server called "action_page.php".</p>
</body>
</html>
【问题讨论】:
-
@Shahab Khan 不,为什么
textarea不好? -
不能用js把它变宽吗?你真的需要多行吗
-
好的,我会用textarea
标签: javascript html css reactjs input