I’m trying to change the background color to my web part title bars, but for some reason I can’t get my CSS modification to work.
First, I’ve made a copy of the default seattle.master and corev15.css files. I uploaded my new master file into the Master Page Gallery and pointed the site to it via the Site Master Page settings. I know that part is working, because as test, I changed the favicon path and I do see that change.
Then, under the Alternate CSS URL, I’m pointing to my custom CSS file that I’ve uploaded to the Style Library. In addition to all of the CSS code included in the corev15.css file, I’ve added this code:
.ms-WPHeader TD{
background-color:#0072c6
}
That doesn’t seem to do anything. After lots of Internet searching, I’ve also tried the alternative methods of pointing to the CSS file directly from the .master file AND putting that code directly on the page within an HTML editor web part. That doesn’t work either..
Any thoughts? This is driving me crazy…
!important is generally only for use as a last resort (mostly when other designers have also used !important.) You should try to increase the specificity of your CSS selector first before resorting to !important.
Hi,
background-color:#0072c6 !important
try adding !important and see.
Thanks,
Here is the CSS block I use/modify for webpart headers.
/* web part headers */
.ms-webpart-titleText.ms-webpart-titleText, .ms-webpart-titleText > a {
background-color: #003471;
font-size: 18px;
/* font-weight: bold; */
color: white;
padding: 5px 5px;
/* -webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px; */
}
Hi Wayne,
So as near as I can tell, MS changed things in 2013. Try this:
.ms-webpart-titleText {
background-color:#0072c6
}
I did a quick check with a CEWP and your code didn’t affect anything, made my change and I now have the blue you are trying to apply.