我试图在两个单词之间强制换行。它适用于最新版本的Chrome和IE9。然而,它在IE11中不起作用。我希望按钮在一行上显示一个单词,在另一行上显示另一个单词。例如,
TestTestTest/
FooFooFooFoo
我不想让文本换行,我想强制第二个单词到另一行。下面是示例代码:
http://jsfiddle.net/VM723/ .BtnSize {
width: 125px;
}
<input type="button" value="TestTestTest/ FooFooFooFoo" class="BtnSize" />
try
.BtnSize {
width: 125px;
white-space:normal;
word-break: break-all;
}
http://www.w3schools.com/cssref/css3_pr_word-break.asp 试试这个:
<button type="button">TestTestTest/ FooFooFooFoo</button>