Home > php教程 > php手册 > Yii 控制dropdownlist / select 控件的宽度和 option 的宽度

Yii 控制dropdownlist / select 控件的宽度和 option 的宽度

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-13 10:58:09
Original
814 people have browsed it

默认情况下,
option的宽度会由options中最宽的元素决定,并且同时决定着select控件的宽度

 

在Yii中,如果需要自定义select控件的宽度,可以用 htmlOptions定义,如下:



$currentSelectSource,
CHtml::listData($modelSource, 'domain_hash', 'site_name'),
array('empty'=>'-- 全 部 --','style'=>'width:200px;')
);?>


如果要自定义option的宽度,就没办法了,只能写CSS来定义。


 

 

 



 

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template