2014-02-26 36 views
0

我很新的CSS,並沒有太多的設計師,但我試圖將它添加到我做的一些JSF無線電選擇項目,但我不明白我需要。排列與CSS的無線電項目

我試圖讓他們出現在每個項目的平均漂亮,所有三個其中相當多的是這樣的:

<h:selectOneRadio type="reset" id="SelectNativity" value="#{searchBean.nativity}" rendered="#{searchBean.byNativity}" styleClass="searchByOtherRadio"> 
<f:selectItem itemValue="1" itemLabel="Native"><br/></f:selectItem> 
<f:selectItem itemValue="2" itemLabel="Nonnative"></f:selectItem> 
<f:selectItem itemValue="3" itemLabel="Both Native and Nonnative in parts of its US range"></f:selectItem> 
</h:selectOneRadio> 

和CSS是這樣的:

.searchByOtherRadio{ 
    font-family: Verdana; 
    font-size: small; 
    color: #000; 
    padding-left:20px; 
    width: 75%;} 

基本上,我怎麼能得到誕生之下的第二個項目接近第一個,我怎樣才能獲得侵入性和聯邦法律地位的第二個項目排列在耶穌誕生第二個項目,使用CSS?

謝謝。

回答

4

使用layout屬性上的文字h:selectOneRadiopageDirection,無需CSS後。

存在用於layout 2個可能的值:

  • lineDirection - 對於水平方向
  • pageDirection - 對於垂直方向。

默認值爲lineDirection

<h:selectOneRadio layout="pageDirection" type="reset" id="SelectNativity" styleClass="searchByOtherRadio"> 
    <f:selectItem itemValue="1" itemLabel="Native"></f:selectItem> 
    <f:selectItem itemValue="2" itemLabel="Nonnative"></f:selectItem> 
    <f:selectItem itemValue="3" itemLabel="Both Native and Nonnative in parts of its US range"></f:selectItem> 
</h:selectOneRadio> 
0

所以我能夠加入到這樣做:

display: block;到我張貼的CSS。

並多次&nbsp;ItemLabel="XYZ"