【问题标题】:Is that possible to next line in Input tag in html css?html css中输入标签的下一行可以吗?
【发布时间】: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>

【问题讨论】:

标签: javascript html css reactjs input


【解决方案1】:

autosize(document.getElementById("comment"));
#comment{
    resize: none;
    height: 16px;
}
<!DOCTYPE html>
<html>
<body>

<h1>The input element</h1>

<form action="/action_page.php">
  <textarea id="comment" name="comment"></textarea><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>
<script src="https://rawgit.com/jackmoore/autosize/master/dist/autosize.min.js"></script>
</html>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-12-26
    • 2011-02-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多