[英]Break lines in <input> tag HTML + CSS
我有類型為“文本”的標簽,限制為2,000個字符。 我想換行,但是“換行:換行;” 不起作用,因為它不是div。
這是CSS:
background: #ffffff;
-moz-box-sizing: border-box;
border: 1px solid #CBD5DD;
border-radius: 2px;
height: 70px;
max-width: 450px;
word-wrap: break-word;
margin: 0;
min-height: 33px;
overflow: visible;
position: relative;
width: 450px;
padding-left:5px;
vertical-align:top;
box-sizing: border-box;
有什么建議么 ? 謝謝
您不能在input[type="text"]
中使用換行符,因為它不支持多行,請改用textarea
。
您不能在input[type="text"]
更改行。您必須使用Textarea
或具有contenteditable="true"
任何元素
例如
[contenteditable="true"] { background: #ffffff; -moz-box-sizing: border-box; border: 1px solid #CBD5DD; border-radius: 2px; max-height: 70px; max-width: 450px; word-wrap: break-word; margin: 0; min-height: 33px; overflow: auto; position: relative; width: 450px; padding-left: 5px; vertical-align: top; box-sizing: border-box; }
<div contenteditable="true"></div>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.