2014-02-26 107 views
0

我想在對話窗口的標題中放置一個圖像primefaces 在那裏我把紅圈我想把圖像放在那裏。如何在對話窗口的標題中放置圖像

enter image description here

,我有overrided的CSS,但它並沒有爲我工作

.ui-widget-header{ 
    background:#6BB508 url("resources/theme/img/br.png") !important; 
    font-weight: lighter!important; 
    text-shadow: none!important; 
    color: #FFFFFF!important; 
    font-size: small!important; 
    background-image: url("../img/succ.png")!important; 
} 
.ui-dialog-titlebar{ 

     background-image: url("../img/succ.png")!important; 


} 

我嘗試了很多,但我沒有找到任何辦法 如何做到這一點.. 在此先感謝

回答

2

嘗試在網址圖片中加入#{request.contextPath}。

例如, 這個代碼顯示此結果

enter image description here

<html xmlns="http://www.w3.org/1999/xhtml" 
     xmlns:p="http://primefaces.org/ui" 
     xmlns:h="http://java.sun.com/jsf/html"> 
    <h:head> 
    <style> 

    .ui-widget-header{ 
    background:#6BB508 url("#{request.contextPath}/images/chrome.png") !important; 
    font-weight: lighter!important; 
    text-shadow: none!important; 
    color: #FFFFFF!important; 
    font-size: small!important; 
    background-image: url("#{request.contextPath}/images/chrome.png")!important; 
} 
.ui-dialog-titlebar{ 

     background-image: url("#{request.contextPath}/images/chrome.png")!important; 


} 
    </style> 
    </h:head> 

    <h:body> 
    <h:form> 
<h:panelGrid columns="1" cellpadding="5"> 
    <p:commandButton id="basic" value="Basic" onclick="PF('dlg1').show();" type="button" /> 

</h:panelGrid> 

<p:dialog id="basicDialog" header="Effects" widgetVar="dlg1"> 
    <h:outputText value="Image background header window" /> 
</p:dialog> 

</h:form> 
    </h:body> 
</html> 
相關問題