开发者

Insert newline between the items of dropdownlist

I want give some space between the items of the dropdownlist. i开发者_高级运维s it possible?

ex:

ddl:

    item1

    item2

    item3


If you mean a <select>, no this isn't possible, at least not in a cross-browser way (unless you add empty, selectable <option> elements, which I wouldn't guess that you want in there.

To do this you need to use something that replaces the <select> with stylable elements, here are some options:

  • Stylish Select Box
  • Select Box Replacement


Try like this

        comboBox1.Items.Add("item1");
        comboBox1.Items.Add("");
        comboBox1.Items.Add("item2");
        comboBox1.Items.Add("");
        comboBox1.Items.Add("item3");
        comboBox1.Items.Add("");


You should use CSS.

example:

select option
{
    line-height: 35px;

}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜