i have a listbox:
<asp:ListBox ID="lstProblems" runat="server" height=200px SelectionMode="Multiple"></asp:ListBox>
and i am unable to size it in IE . IE just picks its own size.
how do i forcefully give it a specific height? if it is a CSS solution please spell it out for me since i do know how to work with CSS>
thanks so much for any guidance
at Andrew’s request here is how the html gets generated: http://pastebin.com/HEdBg4f7
Here is an abbreviated version of the HTML around the lstProblems control. For some reason this control is given a height of 100% rather than 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>
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
With asp.net and IE8, I had a similar problem. The browser displayed the listbox with the wrong height. The problem went away when I added a Font-Size property to the ListBox control. I set it at 1em.
<asp:ListBox ... Font-Size="1em" ...
Method 2
Did you explicitly declared height using CSS?
#lstProblems{height:200px !important; display:inline-block;}
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0