我是CSS的新手,不是一个设计师,但是我试图将其添加到我制作的一些JSF无线电选择项目中,但我无法完全满足我的需求。
我试图让它们在每个项目下均等地显示,所有这三个项目看起来都像这样:
<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使诞生后的第二个项目接近第一项,以及如何让入侵性和联邦法律地位的第二项在诞生下的第二项下排成一行?
谢谢。
使用layout
属性上h:selectOneRadio
的pageDirection
,无需CSS。
有两个可能的值layout
:
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>
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句