我可以在 html 选择选项中有两行文本吗?怎么办?
最佳答案
我知道这是一篇较旧的帖子,但我将把这篇文章留给以后来看的人。
您不能将换行符格式化为一个选项;但是,您可以使用标题属性提供鼠标悬停工具提示以提供完整信息。在选项文本中使用简短的描述符,并在标题中给出完整的描述。
<select>
<option
title="This is my lengthy explanation of what this selection really means, so since you only see 1 on the drop down list you really know that you're opting to elect me as King of Willywarts! Always be sure to read the fine print!"
value="1">1</option>
</select>
关于html - HTML 选择选项中的换行符?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2864238/