1

Similar questions have been asked elsewhere, including on this site, but I just can't seem to make them work on my problem.

I have a listbox, and I'd like to adjust the line height. It would be more readable with some space between each option.

My list box:

<asp:ListBox runat="server" id="lstProjects" autopostback="false" 
     Width="500px" Height="550px" SelectionMode="Multiple" class="c_lists" 
    style="text-align:left; padding-left:5px; font-size:16px; line-height: 50px; " />
</asp:TableCell>

All of the styling I have here (padding, align, font size) works great. But no matter what I do, the line-height is ignored. I tried moving that css to the containing TableDef, and putting a div around this listbox and adding the line-height to that... nothing.

Can anyone tell me what I'm doing wrong?

EDIT:

Here is the first line being rendered on my page (thanks Sahil):

<td><select size="4" name="ctl00$MainContent$lstProjects" multiple="multiple" id="lstProjects" class="c_lists" style="height:550px;width:500px;text-align:left; padding-left:5px; font-size:16px; line-height: 50px; ">
<option value="First List Option">First List Option</option>
buckshot
  • 315
  • 4
  • 15
  • Check the final generated element using your browser's devtools: is line-height being overridden by something else? – Terry Jul 19 '17 at 21:57
  • you might want to try the solution provided in a similar SO question https://stackoverflow.com/questions/20477823/select-html-element-with-height let me know if that helps – Sahil Jariwala Jul 19 '17 at 22:00
  • @Sahil Jariwala, I noodled around with that one, but I couldn't make it work. – buckshot Jul 19 '17 at 22:02

0 Answers0