Php 如何将内联css添加到Yii中的下拉列表中?

Php 如何将内联css添加到Yii中的下拉列表中?,php,css,yii,Php,Css,Yii,这是我的代码: <?php echo $form->dropDownList($model, 'type', CHtml::listData($ab->type, 'id', 'name'), array('class' => 'edit'), array('width:165px')); ?> 我试图将内联css添加到下拉列表中,但我的示例不起作用。为什么?应该是这样的: <?php echo $form->dropDownList($mode

这是我的代码:

 <?php echo $form->dropDownList($model, 'type', CHtml::listData($ab->type, 'id', 'name'), array('class' => 'edit'), array('width:165px')); ?>


我试图将内联css添加到下拉列表中,但我的示例不起作用。为什么?应该是这样的:

<?php echo $form->dropDownList($model, 'type', CHtml::listData($ab->type, 'id', 'name'), array('class' => 'edit', 'style' => 'width:165px')); ?>


你有没有试过这个:数组('style'=>'width:165px')我试过了,但还是不行..这个呢?数组('class'=>'edit','style'=>'width:165px')与其发布完全相同的答案,不如投票支持之前的答案。
<?php echo $form->dropDownList($model, 'type', CHtml::listData($ab->type, 'id', 'name'), array('class' => 'edit', 'style'=>'width:165px;')); ?