【问题标题】:Img in select tag not showing on chrome选择标签中的 Img 未在 chrome 上显示
【发布时间】:2015-11-26 07:01:26
【问题描述】:

这是我的代码,它在 mozilla 上完美运行,但在 chrome 上却不行。

我的代码:

select {
  -webkit-appearance: none;
  -moz-appearance: none;
}

option {
  background: url(image/flags/bg.png) no-repeat;
  padding-left: 20px;
}

【问题讨论】:

  • 你能分享你的html吗?此外,使用简单的 css 几乎不可能更改选择选项的背景。
  • 转到 here 并粘贴您的 html 和 css 代码并分享链接

标签: html css google-chrome select


【解决方案1】:

它不应该显示。您不能将background-image 设置为选项标签。

但是你可以使用一个叫做select2的jquery插件。

http://select2.github.io/select2/#templating

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-03-15
    • 1970-01-01
    • 1970-01-01
    • 2017-08-21
    • 2022-01-10
    • 2016-10-19
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多