Luc*_*cas 10 css class twitter-bootstrap
我想要实现的是为我自己的输入元素禁用Twitter Bootstrap类,并使用类命名login_button.默认情况下,bootstrap.min.css该类会向box-shadow我的input.login_button元素添加不必要的属性等.
我知道我可以定义,box-shadow: none;但我想知道是否有其他可能性来实现这一目标?
Just override the Bootstrap style. As long as Bootstrap is included on your page before your custom CSS then your CSS should override Bootstrap as the specificity of the selector would be the same. Add this to your custom CSS and override the styles accordingly:
input.login_button {
box-shadow: none;
border: none;
line-height: initial;
/* Etc. */
}
Run Code Online (Sandbox Code Playgroud)
这里input.login_button有一个特异性得分,011而Bootstrap input[type="text"]只有一个特异性得分010,这意味着你的自定义样式将足以覆盖Bootstrap,无论CSS的顺序如何.