select 宽度设定
在使用Select时,有时候需要固定宽度,有时候需要自适应,下面说下要设定固定宽度时要注意的地方:
控件设定宽度一般是直接指定width属性即可,但Select设定固度是使用style="width:n"的形式设定,如果只设置width属性,则Select的宽度还是会随下面选择项的宽度变化而变化的,如:
<select width="20px">
<option>1111111111111111111</option>
<option>22</option>
<option>1</option>
<option>44444444444444444444444444444444</option>
</select>
<select style="width:20px">
<option>1111111111111111111</option>
<option>22</option>
<option>1</option>
<option>44444444444444444444444444444444</option>
</select>posted on 2009-09-16 11:52 Master zhu 阅读(3096) 评论(0) 收藏 举报
浙公网安备 33010602011771号