Rendering a hierarchy of “OPTION”s in a “SELECT” tag

后端 未结 7 1872
庸人自扰
庸人自扰 2020-12-03 05:13

My problem is HTML and CSS related. I have a hierarchy type structure that I want to display inside a list. The hierarchy contains Countries, States and Cities (it is three

相关标签:
7条回答
  • 2020-12-03 05:52

    deceze way is much better and was my first idea. As an alternative if that doesn't work is that you can use non-breaking spaces in the tag value:

    <select>
        <option>select me</option>
        <option>&nbsp;me indented</option>
        <option>&nbsp;&nbsp;even more indentation</option>
    </select>
    

    It's far from pretty but it might work for you if the optgroup doesn't.

    0 讨论(0)
提交回复
热议问题