如何在列表框中的列表项之间添加间距? [英] How to add spacing between list items in listbox?
本文介绍了如何在列表框中的列表项之间添加间距?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨朋友们,
这里我有一个问题,就是我需要列表框中的列表项应该有间距。但我运气不好,我无法做到。这可能与否。任何人都可以帮助我。我已经谷歌了,但我找不到具体的解决方案。
问候,
Thanes
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
推荐答案
使用CSS。您不必为每个项添加一个类,您可以使用子选择器来选择
和选项
,只有父级的选择器部分可以带有一个类:
https://developer.mozilla.org/en-US/docs/Web/CSS/Child_selectors [ ^ ]。
你可以使用的样式属性是填充
,或margin
。请试试;这很简单。
(我是否必须解释客户端的列表框呈现为select
元素与选项
元素?:-))
-SA
By using CSS. You don't have to add a class to each item, you can use child selectors forselect
andoption
, 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 bepadding
, ormargin
. Please try; this is pretty simple.
(Did I have to explain that the "list box" is rendered on client side asselect
element withoption
elements? :-))
—SA
嗨朋友们,我准备好了解决问题。需要添加代码:ListBox1.Items.Add();
Hi friends, i m settle the problem ready. need to add the code: ListBox1.Items.Add("");
这篇关于如何在列表框中的列表项之间添加间距?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文