【发布时间】:2014-12-14 06:55:54
【问题描述】:
我有以下选择:
<select name="mySelect">
<option value="1">hello [test]</option>
<option value="2">hello2 [test2]</option>
<option value="3">hello33 [test33]</option>
<option value="4">hel [hel]</option>
</select>
如何对齐选项内的文本以显示如下:
hello____[test]
hello2___[test2]
hello33__[test33]
hel_____ [hel]
我尝试使用 JavaScript 添加空格,但它们不可见。 ( _ 是上面的空格字符)
【问题讨论】:
-
你可以使用
&nbsp;。 -
字体也应该是等宽的。在你的 CSS 中设置它。
-
再次使用  ,它们没有正确对齐...尽管添加了空格。
-
所以
hello&nbsp;&nbsp;&nbsp;&nbsp;[test]不能正常工作?截图或小提琴会很好。
标签: javascript html css html-select