<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style>
.LongSelect{
width: expression((this.offsetWidth>100)?'auto':'100');
}</style>
</head>
<body>
<select class=LongSelect ><option>fdsafdsafdsafdasfdsafdsaf fdsa fdsafdsaf dasfdsafsd</select><br>
<select class=LongSelect ><option>dsafsd</select><br>
<select class=LongSelect ><option></select><br>
<select class=LongSelect ><option>11</select><br></body>

解决方案 »

  1.   

    to_JK_10000(JK):
    大哥,谢谢
    不过不是我要的效果!宽度100是固定的,不变化
    是下拉的时候显示出来更宽的内容,不被下拉条截断
      

  2.   

    应该不行.自己模拟Demo:
    http://webfx.eae.net/dhtml/combobox/combo_demo.htm
    Download:
    http://webfx.eae.net/dhtml/combobox/ComboBox.zip
      

  3.   

    设置样式
    { overflow-x : auto} 
    或者脚本里面object.style.overflowX ="auto"
      

  4.   

    哦,style width=100是不可以的。
      

  5.   

    不会吧,太惨了
     overflow-x : auto在什么时候有效?
    不用模拟的就没有办法了吗
      

  6.   

    当然了.你以为微软的select允许你有那么多的变化?当初他能有那么多改变已经让我惊异了.
      

  7.   

    <select style="overflow:visible">
      <option>11111111111111111111111111
    </select>