简体   繁体   English

文本框自动换行不适用于CSS(自动换行:断行)

[英]Textbox word wrap not working with CSS (word-wrap: break-word)

My Textbox value is more than 20 words. 我的文本框值超过20个字。

 .customized { display: block !important; white-space: normal !important; word-wrap: break-word !important; word-break: break-all; width: 100px !important ; } 
 <input type="text" class="form-control customized" value="@item.value"/> 

Text-wrap is not being applied to my textbox, tried in all major browsers, did I miss something? 文字换行没有应用到我的文本框中,在所有主流浏览器中都尝试过,我错过了什么吗?

It's not a textbox. 这不是文本框。 You are using input type="text" instead of "textarea" 您正在使用输入type =“ text”而不是“ textarea”

据我所知,自动换行不适用于使用html或css的输入文本框...使用textarea代替

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM