相关疑难解决方法(0)

将HTML输入按钮的文本值包装在多行上

如何使用type="button"属性将文本移动到HTML输入元素中的新行?

我有以下代码:

<input type="button" id="btnTexWrapped" value="I see this is a long sentence here." style="width: 200px;" />
Run Code Online (Sandbox Code Playgroud)

我希望按钮的文本值包含在两行中.我尝试将其键入HTML的下一行.它没有像我预期的那样工作:

<input type="button" id="btnTexWrapped" value="I see this is a long 
sentence here." style="width: 200px;" />
Run Code Online (Sandbox Code Playgroud)

我也试过使用white-space固定的所有选项width: 200px;,但仍然无效.

我可以静态修复长度,宽度或其他值:因为控件不会改变.

html input button word-wrap

13
推荐指数
4
解决办法
4万
查看次数

标签 统计

button ×1

html ×1

input ×1

word-wrap ×1