2011-10-06 99 views
1

我有CakePHP的形式产生AA单群复选框勘定风格/类复选框的标签在CakePHP

echo $form->input('Interest.interest_id', array('label' => __l('Interests'), 'multiple' => 'checkbox')); 

有一个称为兴趣主要标签,然后为每个复选框标签产生的,我该如何申请一个独立的类风格的复选框的标签?

代码片段

<label for="InterestInterestId">Interests</label> 
<input type="hidden" value="" name="data[Interest][interest_id]"> 
<div class="checkbox"> 
<input id="InterestInterestId8" type="checkbox" value="8" name="data[Interest][interest_id][]"> 
<label for="InterestInterestId8">Label of Checkbox</label> 
</div> 

我的主要目标是让复选框显示标签的很好内嵌盈,但由于其他造型它却没有出现这样的违约

+0

你可以包括HTML对于这两种标签的片段? –

+0

@Allen - 我已经添加了一个片段 – Roland

回答

1

我看你能辨别你的造型为复选框标签为:

.checkbox input[type="checkbox"] { 
    display: inline; 
} 
.checkbox label { 
    display: inline; 
} 

,对我的工作,但我不知道你有什么CSS为这个标签可能是和poorly其他标签riting。这里是工作代码:

http://jsfiddle.net/XBXVs/

+0

我将如何去添加内联样式? – Roland

+0

我意识到这些元素默认是内联=)您也可以使用“float”。 –

+0

是的,他们只是页面使用样式,说:显示:块;这会导致问题,我不幸无法删除块,所以我需要覆盖它 – Roland