【问题标题】:How to style select tags on a Mac如何在 Mac 上设置选择标签的样式
【发布时间】:2014-02-28 15:48:43
【问题描述】:

有谁知道如何为 mac 设置“选择”标签的样式。铬野生动物园等?

我知道你可以通过添加 -webkit-appearance: none; 来去除用户样式代理。但这也摆脱了箭头。

还有其他方法吗,还是只有这一种?

这是我的小提琴。

http://jsfiddle.net/S4TfZ/1/

<div class="col-md-3 col-sm-3 col-xs-12 no-padding-left">
            <select class="form-control form-location indent-left full-width">
                <option>Select</option>
            </select>
        </div>
        <div class="col-md-3 col-sm-3 col-xs-12 no-padding-left">
            <select class="form-control form-location indent-left full-width">
                <option>Select</option>
            </select>
        </div>
        <div class="col-md-3 col-sm-3 col-xs-12 no-padding-left">
            <select class="form-control form-location indent-left full-width">
                <option>Select</option>
            </select>
        </div>
        <div class="col-md-4 col-sm-4 col-xs-12 push-right no-padding-right ">
            <div class="arrow-box">
                <p>Sell yourself and say what makes you, you</p>
            </div>
        </div>

【问题讨论】:

  • 也许您应该尝试使用一些 jQuery 插件来执行此操作,但随后它将应用于所有浏览器中的select,而不仅仅是 OS X 中的那些。
  • 我同意@Zentaurus,可能有办法做到这一点,但使用 JS/jQuery,结果会更清晰,在不同浏览器中看起来更相似。
  • 好的,谢谢,我的 jquery 不是很强大。所以你有什么建议吗??

标签: css forms google-chrome coding-style


【解决方案1】:

使用 CSS 设计 &lt;select&gt; 菜单非常困难。如果我需要样式化它,我会使用 jQuery。使用 jQuery,您可以控制代码及其行为方式,这比仅使用 CSS 好得多。我建议你阅读这篇很有帮助的文章:
How to style HTML select/option tag?
http://gregfranko.com/jquery.selectBoxIt.js/
http://bavotasan.com/2011/style-select-box-using-only-css/

【讨论】:

    猜你喜欢
    • 2011-08-18
    • 1970-01-01
    • 2017-06-13
    • 2020-12-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-02-04
    • 2013-02-15
    相关资源
    最近更新 更多