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

后端 未结 7 1894
庸人自扰
庸人自扰 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:43

    I was able to accomplish this using the NO-BREAK SPACE unicode character. http://www.fileformat.info/info/unicode/char/00a0/index.htm

    Copy-paste the character from that page into code and voila: https://jsfiddle.net/fwillerup/r9ch988h/

    (  didn't work for me because I was using a library for fancy select boxes that would inject them verbatim.)

提交回复
热议问题