请问怎么设置下拉列表的长度,可以保证大概40个汉字的长度显示<%@ page language="java" pageEncoding="GB2312"%>
<HTML>   
<HEAD>   
<META http-equiv='Content-Type' content='text/html; charset=gb2312'>   
<TITLE>可输入的下拉框</TITLE>   
</HEAD>   
<BODY >   
<div style="position:relative;">   
<span style="margin-left:100px;width:18px;overflow:hidden;">   
<select style="width:118px;margin-left:-100px" onchange="this.parentNode.nextSibling.value=this.value">   
<option value="NI11">NI11--苹果</option>   
<option value="NI22">NI22--香蕉</option>   
<option value="NI33">NI33--橘子</option>   
</select></span><input name="box" style="width:100px;position:absolute;left:0px;">   
</div>   
</BODY>
</HTML>如NI11--苹果苹果苹果苹果苹果苹果苹果苹果苹果苹果苹果苹果苹果苹果苹果苹果苹果苹果苹果苹果

解决方案 »

  1.   

    <%@ page language="java" pageEncoding="GB2312"%>
    <HTML>   
    <HEAD>   
    <META http-equiv='Content-Type' content='text/html; charset=gb2312'>   
    <TITLE>可输入的下拉框</TITLE>   
    </HEAD>   
    <BODY >   
      <div style="position:relative;">   
    <span style="margin-left:600px;width:18px;overflow:hidden;">   
    <select style="width:618px;margin-left:-600px" onchange="this.parentNode.nextSibling.value=this.value">   
    <option value="NI11">NI11--苹果苹果苹果苹果苹果苹果苹果苹果苹果苹果苹果苹果苹果苹果苹果苹果苹果苹果苹果苹果</option>   
    <option value="NI22">NI22--香蕉</option>   
    <option value="NI33">NI33--橘子</option>   
    </select></span><input type="text"name="box" style="width:600px;position:absolute;left:0px;">   
    </div>   
    </BODY>
    </HTML>