0

我在显示<h:commandButton>. 例如,请看下面的代码

<td align="left"  style="float: left;">
            <h:commandButton value ="Reset Demand To Default"  styleClass="refresh-button-style" />
        </td>

我已经为这个按钮创建了样式类,样式类的代码在下面指定。

.refresh-button-style
{
word-wrap: break-word !important;
background-color:#2996EF;
height:40px;
width:100px;
font-size:13px;
text-align: center;
font-family: Arial;
 }

当我尝试运行 xhtml 文件并禁用标签值时,标签值似乎水平显示。它确实会自动换行,因此只显示按钮标签的一部分。您能否告诉我如何实现按钮的自动换行并在命令按钮中显示整个标签值。

4

1 回答 1

2

尝试以下 css 属性:

white-space:normal;

这应该按预期包装文本(source)。

于 2012-08-02T08:58:33.410 回答