input[type="submit"] {
white-space: normal;
width: 150px;
float:right;
text-align: right;
}
<input type="submit" value="J'essaie gratuitement 30 jours" />
另外还有两种方法:
<button type="submit">Multiple line<br/>input</button>
并且
在输入值之间使用
回车符:
<input type="button" value="Multiple line input" style="text-align:center;">
然而,最后一种方法在IE10中不起作用。
button
代替 input
:
.right-aligned {
text-align: right;
}
<button type="submit" class="right-aligned">Text <br /> broken </button>
按钮可以接受其他各种标签,例如<br />
、<span>
。
然后,您可以使用CSS按照自己的意愿对其进行样式设置(请参见代码片段中的CSS类和规则)。
<input type="button" value="Really
Tall
 Button">
这是对我有效的:
div.full {
width:500px;
background-color:grey;
}
div.left {
float:left;
width:60%
}
button {
width:40%;
text-align:right;
cursor:pointer;
}
div.underline {
width:100%;
}
<div class='full'>
<div class='left'>
there is a part of text
</div>
<button>J'essaie gratuitement
<div class='underline'>30 jours</div>
</button>
</div>
我刚刚添加了一些CSS来保持按钮的大小。而换行并不是一个很好的做法。最好使用CSS来处理。