加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > PHP教程 > 正文

cakephp – 如何水平排列单选按钮而不是垂直排列?

发布时间:2020-12-13 22:07:02 所属栏目:PHP教程 来源:网络整理
导读:我一直在寻找 Cookbook – 7.3.3 Automagic Form Elements试图找到一种方式让单选按钮水平排列而不是垂直排列.我一直在看’div’= ‘class_name’$options也是$options [‘between’],$options [‘separator’]和$options [‘after’]但是不成功.这样做有“
我一直在寻找 Cookbook – 7.3.3 Automagic Form Elements试图找到一种方式让单选按钮水平排列而不是垂直排列.我一直在看’div’=> ‘class_name’$options也是$options [‘between’],$options [‘separator’]和$options [‘after’]但是不成功.这样做有“蛋糕”方式吗?

<?=$form->input('Product Type',array(
     'type' => 'radio','id' => $tire['ProductType']['id'],'name' => $tire['ProductType']['id'],'options' => array(2=>'Tire Manufacturer',7=>'Rim Manufacturer '),));?>

相当于此

<label>Product Type</label>
<div style="padding-top:5px;">
    <input type="radio" name="data[Manufacturer][product_type_id]" value="<?=$tire['ProductType']['id']?>"> Tire Manufacturer &nbsp;&nbsp;
    <input type="radio" name="data[Manufacturer][product_type_id]" value="<?=$wheel['ProductType']['id']?>"> Rim Manufacturer
</div>

解决方法

最简单的方法是将每个单选按钮放在“LI”标签内,然后将CSS样式应用于“UL”,告诉它将水平而不是垂直显示“LI”标签.你可以找到很多水平列表设计 here.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读