【问题标题】:Select background white/transparent - Chrome OSx选择背景白色/透明 - Chrome OSx
【发布时间】:2014-03-27 15:52:18
【问题描述】:

在我的一生中,我无法在 OSx 上的 Chrome 中删除选择框上的背景/框阴影。我需要它像其他输入一样是纯白色的。看这里:

http://index1.staging.homeflow.co.uk/pdrum/register.html

一些正在使用的代码不起作用:

background: #ffffff;
background: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#ffffff));
background: -moz-linear-gradient(top, white, white);
background-image: -webkit-linear-gradient(top, rgba(255, 255, 255, 1) 0px, rgba(255, 255, 255, 1) 0px);
-moz-box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;

【问题讨论】:

    标签: css macos google-chrome select option


    【解决方案1】:

    #pd-signin select 上设置-webkit-appearance: inherit; 为我删除了它。 那么看来你需要添加一些箭头来表明它是一个下拉菜单。

    关于 SW4 的评论:

    我不会删除任何焦点元素的轮廓,因为这不利于可访问性。

    另请参阅 Chris Coyier 的这篇文章

    Dropdown default styling - Chris Coyier

    火狐

    -moz-appearance: none;
    text-indent: 0.01px;
    text-overflow: '';
    

    From this answer

    【讨论】:

    • 这似乎可以完成这项工作,我可以在 Firefox 中的默认箭头后面放置一个小箭头。 -moz 外观:无;似乎没有隐藏默认值?
    • 更新了原始答案以包含 Firefox 修复。
    【解决方案2】:

    试试:

    select{
       -webkit-appearance: none;
       box-shadow: none !important;
    }
    :-webkit-autofill { color: #fff !important; }
    

    您可能还想使用:

    select:focus { outline: none; }
    

    【讨论】:

      猜你喜欢
      • 2014-08-21
      • 2013-04-03
      • 2015-06-22
      • 2019-01-24
      • 1970-01-01
      • 1970-01-01
      • 2018-03-25
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多