Changing the WP Title Style reflects every web part on the Page

Changing the WP Title Style reflects every web part on the Page

When I edit the Style of a Web Part with a style like the following

<style type="text/css"> .ms-WPTitle {font-weight:Bold !important; color:gray !important;} </style>

It reflects every webpart's title for the Page..How can I make it effect for only a single Web Part.

Thanks,

you need to target the CSS to the classes inside the web part's ID. Use the F12 Developer Tools to find the ID of the web part. It will look something like

MSOZoneCell_WebPartWPQ2

Then you can use

<style type="text/css">

#MSOZoneCell_WebPartWPQ2 .ms-WPTitle {
font-weight:Bold !important;
color:gray !important;}
</style>


The custom CSS will now only apply for the ms-WPTitle inside the MSOZoneCell_WebPartWPQ2 .

Copyright © 2007-2012 www.chuibin.com Chuibin Copyright