2016-04-13 46 views
0

我正在处理一个JSF页面中的primeface框架sentinel主题。我明白大部分问题,但我锁定更改按钮高度。JSF PrimeFaces - 按钮高度不变

我试图给 style="height:100px"style="line-height:100px"styleClass="Fs25"<p:button />但按钮的颜色区域永远不会改变。

我看着sentinel主题的默认login.xhtml,我看到按钮并复制代码,结果在我的页面中又是一样的。

我的问题是什么家伙。我一遍又一遍地想念什么?

smallenter image description here

这里是实时预览Login Page

+1

检查了元素(例如使用Chrome)吗?也许另一个风格类覆盖您的设置。你可以尝试'height:100px!important',虽然这不是最佳做法。 – simdevmon

+0

我没有尝试在Chrome中,但情况,我用mozilla打开login.xhtml也@simdevmon – mismanc

+0

这里是实时预览http://www.primefaces.org/sentinel/login.xhtml @simdevmon – mismanc

回答

0

确定后,我检查CSS我发现

.ui-button .ui-button-text { 
    display: block; 
    line-height: normal; 
} 

这是我如何解决这个问题

head标签

<style> 
#bigbtn .ui-button-text{ 
    line-height: 60px; <!-- Height of Button --> 
    font-size: 20px; <!-- Size of Button Text --> 
} 
</style> 

body

<div id="bigbtn"> 
    <p:button value="Big Button" /> 
</div> 

可能有更好的答案。我也想听到他们。 谢谢。