css - 如何删除 Internet Explorer 8 IE8 中的默认下拉箭头?

标签 css select drop-down-menu

<分区>

此 CSS 代码无效。

select::-ms-expand {
    display: none;
}

我的下拉代码:

select::-ms-expand {
    display: none;
}

select {
    width: 100px;
    height: 30px;
    -webkit-appearance: none; /* gets rid of default appearance in Webkit browsers*/
    -moz-appearance: none; /* Get rid of default appearance for older Firefox browsers */
    -ms-appearance: none; /* get rid of default appearance for IE8, 9 and 10*/
    appearance: none;
    background-color: none;
    border: none;
    border-top-right-radius: 0px;
    border-bottom-right-radius:0px;
    -webkit-border-top-right-radius:0px;
    -moz-border-bottom-right-radius:0px;
    background-image: url('../img/arrow_question.png');
    background-position: center;
    background-size: 30%;
    background-repeat: no-repeat;
}

enter image description here

我找了很久都没有找到解决办法。

最佳答案

使用 appearance: none; 来实现您想要的。

例如,

select{
    appearance: none;
    -moz-appearance: none;
    -webkit-appearance: none;
    background: url("yourBackroundImagePath.extension") no-repeat scroll 0 0 transparent;

}
select::-ms-expand{
    display: none;
}

希望这对您有所帮助。

关于css - 如何删除 Internet Explorer 8 IE8 中的默认下拉箭头?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23540026/

上一篇:css - (RoR) 即使我将它们移动到不同 Controller 的唯一 CSS 文件,样式仍然适用吗?

下一篇:html - 全屏背景,固定位置在正文上方和内容下方

相关文章:

java - 无法执行查询

MySQL 在 select 语句中生成带有循环的列

mysql - 将一个表与另一个表中的多行联接

css - 使用CSS下拉背景颜色

html - 链接不显示链接

html - 如何同时实现跨浏览器的min-height和max-height?

c# - 在 c# 的 gridview 编辑模式下填充下拉列表的问题

drop-down-menu - 有没有办法在 SwiftUI 中以下拉方式填充 TextField?

html - 将字体应用于带有 HTML 字符和标签的输入字段中的文本

css - 如何使用响应式网格系统将我的 Logo 置于导航中心?