在IE7中增加列表框的高度



我有一个列表框:

<asp:ListBox ID="lstProblems" runat="server" height=200px SelectionMode="Multiple"></asp:ListBox>

,我无法在IE中调整大小。IE只是选择自己的大小。

我如何强制给它一个特定的高度?如果它是一个CSS解决方案,请拼出来给我,因为我知道如何使用CSS>

非常感谢您的指导

在Andrew的请求下,下面是生成html的方式:http://pastebin.com/HEdBg4f7

这里是lstProblems控件周围的HTML的缩写版本。由于某些原因,这个控件的高度是100%,而不是200px。

<fieldset>
        <legend>Section B</legend>
        <dl>
            <dt><label for="problemTextBox">Problem:</label></dt>
            <dd><input name="problemTextBox" type="text" id="problemTextBox" size="50" /></dd>  
        </dl>     
        <dl>
            <dt><label for="lstProblems">Problems List:</label></dt>
            <dd>
               <select 
                  size="4" 
                  name="lstProblems" 
                  multiple="multiple" 
                  id="lstProblems" 
                  style="height:100%;"
              >
              </select>
            </dd>            
        </dl>  
        </fieldset>

使用asp.net和IE8时,我遇到了类似的问题。浏览器显示的列表框高度不正确。当我向ListBox控件添加Font-Size属性时,这个问题就消失了。我把它设置为1em

<asp:ListBox ... Font-Size="1em" ...

您是否使用CSS显式声明height ?

#lstProblems{height:200px !important; display:inline-block;}

最新更新