【问题标题】:How to underline selected option in field select如何在字段选择中为所选选项加下划线
【发布时间】:2016-04-14 09:31:02
【问题描述】:

请原谅我的基本问题。我是初学者。

如何使select字段中的选定值带下划线,但对应列表中的其他项目(options)不带下划线?

不幸的是,当我使用属性style="text-decoration: none" 标记select,并将style="text-decoration: lined-through" 属性标记为选定的option 时,结果select 字段中的选定值没有下划线。

另一方面,当我使用属性style="text-decoration: lined-through" 标记select all 对应的options 也会变成下划线(尽管有style="text-decoration:none")。

【问题讨论】:

  • 请发布一些 HTML。很难猜出你的意思

标签: html jsp select option underline


【解决方案1】:

您正在寻找的是“:checked”。

select option:checked { 
   text-decoration: lined-through; /*or underline if you want*/
}

【讨论】:

  • 不好意思,请问您是指css还是javascript?
猜你喜欢
  • 2016-01-20
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-09-26
  • 1970-01-01
相关资源
最近更新 更多