【问题标题】:Button text won't line break IE11 (Chrome, IE9 fine)按钮文本不会换行 IE11(Chrome,IE9 很好)
【发布时间】:2016-09-13 17:53:30
【问题描述】:

我试图在两个单词之间强制换行。它适用于最新版本的 Chrome 和 IE9。但是,它在 IE11 中不起作用。我希望按钮在一行上显示一个单词,在另一行上显示另一个单词。例如,

TestTestTest/
FooFooFooFoo

我不希望文本换行,我想将第二个单词强制到另一行。下面是示例代码:

http://jsfiddle.net/VM723/

    .BtnSize {
        width: 125px;
    }
    <input type="button" value="TestTestTest/&#10;FooFooFooFoo" class="BtnSize" />

【问题讨论】:

标签: html cross-browser line-breaks


【解决方案1】:

试试

   .BtnSize {
        width: 125px;
        white-space:normal;
        word-break: break-all; 
    }

http://www.w3schools.com/cssref/css3_pr_word-break.asp

【讨论】:

    【解决方案2】:

    试试这个:

    <button type="button">TestTestTest/&#10;FooFooFooFoo</button>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-04-08
      • 1970-01-01
      • 2020-09-28
      相关资源
      最近更新 更多