Click here to Skip to main content
15,886,101 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi Friends,

Here i have a problem, which is i need the list items in listbox should be have spacing. But my bad luck, i cannot make it. Is that possible or not. Can anyone help me please. I already google it, but i could not find a specific solution.

Regards,

Thanes
Posted

By using CSS. You don't have to add a class to each item, you can use child selectors for select and option, only only the parent's part of selector can come with a class:
https://developer.mozilla.org/en-US/docs/Web/CSS/Child_selectors[^].

The style property you can use would be padding, or margin. Please try; this is pretty simple.

(Did I have to explain that the "list box" is rendered on client side as select element with option elements? :-))

—SA
 
Share this answer
 
v2
Comments
CgKumar 12-Nov-15 21:12pm    
Thanks for your suggestion friend...;)
Sergey Alexandrovich Kryukov 13-Nov-15 2:15am    
You are welcome. And will you accept this answer formally? it does work.
However, what can I expect from one who accepted his own "answer", actually not an answer at all, a fake? :-(
—SA
Hi friends, i m settle the problem ready. need to add the code: ListBox1.Items.Add("");
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900