2012-07-10 99 views
0

我想實現下面來看一下:http://www.primefaces.org/showcase/ui/selectManyCheckbox.jsf擺脫邊框的周圍號碼:selectManyCheckBox

通知有分量周圍沒有CSS-邊界在PrimeFaces展示網站。

<h:outputText value="Horizontal: " /> 
<p:selectManyCheckbox value="#{formBean.selectedOptions}"> 
    <f:selectItem itemLabel="Option 1" itemValue="Option 1" /> 
    <f:selectItem itemLabel="Option 2" itemValue="Option 2" /> 
    <f:selectItem itemLabel="Option 3" itemValue="Option 3" /> 
</p:selectManyCheckbox> 

但是,在我的實現中,我在組件周圍有不需要的邊框。我曾嘗試添加style =「border-style:none;」即

<p:selectManyCheckbox value="#{formBean.selectedOptions}" style="border-style: none;">  

沒有任何結果。我有一個default.css文件依據:

.ui-widget, .ui-widget .ui-widget { 
    font-size: 80% !important; 
} 

我不認爲CSS的資源將在這個問題上有任何影響,但我可能是錯的。

我看不到差異瀏覽器之間的任何區別。

你能告訴我爲什麼我有邊框,我怎麼才能擺脫它們,只有在這個特定的組件?

問候函

+0

既然你不提供任何自己的代碼,這是很難幫助你。但猜測會是這個邊界:0;有助於。請不要將它放在內聯(在元素上),而是放在一個班級中。 – 2012-07-10 19:13:33

+0

您使用的是什麼瀏覽器和瀏覽器版本號? – BestPractices 2012-07-10 20:09:37

回答

1

邊界? Primefaces'p:selectManyCheckbox默認情況下沒有邊框。

無論如何,如果您想覆蓋任何樣式規則,您可以使用!important

這應該刪除任何邊界:

<p:selectManyCheckbox value="#{formBean.selectedOptions}" style="border-style: none !important;"> 
0

我不同意havning沒有國界的。我試圖刪除所有的CSS,但我仍然有邊界。可能是主題特定的。

我不得不使用以下命令:

.noBorder tr,.noBorder td { 
    border: none !important; 
} 



<p:selectManyCheckbox value="#{formBean.selectedOptions}" styleClass="noBorder"> 
         <f:selectItem itemLabel="Option 1" itemValue="Option 1" /> 
        </p:selectManyCheckbox>