【发布时间】:2012-02-01 15:58:22
【问题描述】:
我需要在我的按钮内换行,所以我找到了这个解决方案:
How to wrap text of html button with fixed width
但是,在应用解决方案后,我注意到按钮的垂直对齐方式发生了变化。这是截图:
代码如下:
<html>
<head>
<title>Button Wrap</title>
<style type="text/css">
INPUT.StandardButton
{
WIDTH: 87px;
HEIGHT: 38px;
font-size: 10pt;
Font-weight: bold;
cursor: pointer;
FONT-FAMILY: Arial, Verdana;
COLOR: #0049A5;
}
</style>
<head>
<body>
<input type="button" value="NoWrap" class="StandardButton" />
<input type="button" value="This is Test 1" class="StandardButton" style="white-space: normal;" />
<input type="button" value="This is Test 2" class="StandardButton" style="white-space: normal;" />
<input type="button" value="This is Test 3" class="StandardButton" style="white-space: normal;" />
</body>
</html>
知道是什么导致了对齐变化吗?谢谢!
【问题讨论】:
标签: html css button alignment word-wrap