Set width of dropdown element in HTML select dropdown options

后端 未结 7 1107
醉话见心
醉话见心 2020-11-27 21:36

I am working on a website that involves automatically populating a select box using a PHP script. This all works fine except the problem is that what I am using to populate

7条回答
  •  自闭症患者
    2020-11-27 21:49

    You can style (albeit with some constraints) the actual items themselves with the option selector:

    select, option { width: __; }
    

    This way you are not only constraining the drop-down, but also all of its elements.

提交回复
热议问题