I have a listbox and I want to decrease its width.
我有一个列表框,我想减少它的宽度。
Here is my code:
这是我的代码:
This code works on IE 6 but not in Mozilla Firefox (latest version). Can anybody please tell me how I can decrease the width of the dropdown list on Firefox?
If you want to change the width of the option you can do this in your css:
如果要更改选项的宽度,可以在css中执行此操作:
#wgtmsr option{
width:150px;
}
Maybe you have a conflict in your css rules that override the width of your select
也许你的css规则中有一个冲突,它会覆盖你选择的宽度
DEMO
DEMO
#2
5
try the !important argument to make sure the CSS is not conflicting with any other styles you have specified. Also using a reset.css is good before you add your own styles.