2016-04-13 43 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> 

可能有更好的答案。我也想聽到他們。 謝謝。