【问题标题】:Changing outerglow of bootstrap 3.1.x textarea doesn't seem to work更改 bootstrap 3.1.x textarea 的外发光似乎不起作用
【发布时间】:2014-04-02 07:52:43
【问题描述】:

我找到了以下问题和相关答案来更改引导输入类型的外发光:

How can I change the border/outline color for input and textarea elements in Twitter Bootstrap?

然而,它似乎不适用于 textareas,即使 textarea:focus 是 CSS 的目标。所有其他输入类型都可以正常工作。有谁知道为什么会这样?

【问题讨论】:

    标签: twitter-bootstrap textarea


    【解决方案1】:

    检查没有设置样式的元素肯定是<textarea>

    如果是这样,也许以后的样式会覆盖您添加的样式 - 通过将 !important 放在新样式的末尾进行测试,例如:

    textarea:focus, input:focus, input[type]:focus, .uneditable-input:focus {   
        border-color: rgba(229, 103, 23, 0.8)!important;
        box-shadow: 0 1px 1px rgba(229, 103, 23, 0.075) inset, 0 0 8px rgba(229, 103, 23, 0.6)!important;
        outline: 0 none!important;
    }
    

    如果它被覆盖,最好在你的 textarea 上设置一个新类并将你想要的样式应用到该类,然后在 css 中而不是覆盖样式。

    【讨论】:

    • 感谢红蜘蛛1984!首先,它确实是一个文本区域,所以没关系。但是,即使我的样式表是最后加载的,样式似乎也被覆盖了,奇怪……但我已经用 !important 部分修复了它。我现在不想在我的 textarea 中添加一个新类。
    猜你喜欢
    • 1970-01-01
    • 2020-04-10
    • 1970-01-01
    • 2015-04-18
    • 1970-01-01
    • 1970-01-01
    • 2013-07-03
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多