Yii CHtml :: radioButtonList - CSS水平对齐 [英] Yii CHtml::radioButtonList - CSS to align horizontally

查看:223
本文介绍了Yii CHtml :: radioButtonList - CSS水平对齐的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用yii框架为我的发展。我写CSS,能够正确对齐我的< input 标签在html中,我使用相同的CSS为yii和对齐被搞砸。



https://i.stack.imgur.com/9din5.pngalt =我想让它显示如下>



这里是yii代码我有

 < div id =gender> 
< label>性别:< / label>
<?php echo CHtml :: radioButtonList('gender_code','',array('Male'=>'Male','Female'=>'Female'),array('separator' >)); >
< / div>

CSS

 < style type =text / css> 
div#gender {
margin-top:20px;
margin-left:200px;
}

div#gender label
{
font-weight:bold;
font-size:0.9em;
float:left;
margin-left:2px;
text-align:left;
width:100px;
}

< / style>

并且它如下图所示



解决方案

看起来您可能需要

  div#gender input 
{
float:剩下;
}


I am using yii framework for my development . I wrote CSS and able to align my <input tags in html properly and I am using the same CSS for yii and the alignment is messed up . Could some help me on this ?

I wanted it to be displayed like below

Here is the yii code I have

<div id="gender">
        <label>Gender :</label>
        <?php echo CHtml::radioButtonList('gender_code','',array('Male'=>'Male','Female'=>'Female'),array('separator'=>'')); ?>
    </div>

CSS

 <style type="text/css">          
           div#gender {
                    margin-top:20px;
                    margin-left:200px;
           }      

           div#gender label
           {
                   font-weight: bold;
                   font-size: 0.9em;
                   float:left;
                   margin-left:2px;
                   text-align:left;
                   width:100px;
            }

</style>

and it is coming as below image

解决方案

Looks like you might need

div#gender input
{
    float:left;
}

这篇关于Yii CHtml :: radioButtonList - CSS水平对齐的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆