我们如何调整p:commandbutton的大小或宽度 [英] How can we adjust p:commandbutton size or width

查看:214
本文介绍了我们如何调整p:commandbutton的大小或宽度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的工作环境是:Primefaces 4.0 with JSF 2.0
我的目标是在表单中设置命令按钮的宽度相同。我找到 style =font-size:10px来设置按钮的字体大小,这是更改按钮的标签大小。我想更改按钮的大小

My working environment is: Primefaces 4.0 with JSF 2.0 My aim is to set width of command button same in the form. I find style="font-size:10px" to set button's font size which is changing button's label size. I want to change button's size

推荐答案

您可以在commandButton中使用style属性和css属性width和height。

You can use the style attribute in the commandButton with the css properties width and height.

<p:commandButton id="button" value="Click"                              
                 actionListener="#{myBean.doAction}" 
                 style="width:100px;height:100px"/>

要为页面上的所有commandButtons设置相同的值,请将以下css添加到jsf页面。

To set the same value for all the commandButtons on a page,add the following css to your jsf page.

       .ui-button{
            width:100px;
            height:100px;
        }

这篇关于我们如何调整p:commandbutton的大小或宽度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆