I have an issue where I am trying to override the twitter bootstrap (v 2.0.3) primary buttons with my own colors, and it works fine in IE, but not in FireFox or Chrome. So on my page, I first link to bootstrap.css, and then right after that, I link to my own stylesheet that has my own changes. Now, my classes are named the same as the bootstrap ones, but I would think mine would take precedence as my stylesheet is linked to after the bootstrap one:
<link href="~/Content/bootstrap.css" rel="stylesheet" type="text/css" />
<link href="~/Content/mystyles.css" rel="stylesheet" type="text/css" />
…so in mystyles.css, I have the following (which again, is just like in bootstrap.css, but I have different colors):
.btn-primary {
background-color: #faa732 !important;
*background-color: #f89406 !important;
background-repeat: repeat-x !important;
border-color: #f89406 #f89406 #ad6704 !important;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25) !important;
background-image: linear-gradient(top, #fbb450, #f89406) !important;
}
.btn-primary:hover,
.btn-primary:active,
.btn-primary.active,
.btn-primary.disabled,
.btn-primary[disabled] {
background-color: #f89406 !important;
*background-color: #df8505 !important;
}
.btn-primary:active,
.btn-primary.active {
background-color: #c67605 \9 !important;
}
I even put !important in them, and it still renders odd, with the old colors, and then adds my color when I hover (but only halfway). Tried to post images, but it won’t let me….basically, in IE, the color is correct and orangish, but in the other browsers, it is blue with an orange outline (blue is the default primary color in bootstrap), and when I hover over it, half the button highlights orange, but the other half is still blue, and when I full click on it, then it becomes orange.
Thanks!!
You’re on the right track, you just need to cancel out the
background-imageproperty set in those buttons to get the color you want, so add the following in tandem with your definitions and it should work:Demo: http://jsfiddle.net/ETagZ/