SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have 2 CQWP's in my Welcome Page for a document set.

By default, they look like this:

enter image description here

I was hoping there were an easy way I could either make the Names of the webparts Bold or Highlighted, like so:

enter image description here

Any pointers?

...I took some of the header out and only show down to one webpart.

" EncodeMethod='HtmlEncode'/>      

share|improve this question
up vote 2 down vote accepted

If I have understood correctly you just want to change the styling on the title of the web part so this is just CSS - no need to play with XSLT.

This is the standard tag at the top of a web part. If you create some CSS such as:

.ms-WPTitle {color: red}

This will style the title font - but note that it will style all the web part headers.

If you want to be more selective then you need to be more precise about which web parts you want to style. You can either do this by styling all web parts in a zone or by identifying the ID of the web part:

<td title="Content Query - Displays a dynamic view of content from your site." class="ms-WPHeaderTd" id="WebPartTitleWPQ6">

You can now use something like:

#WebPartTitleWPQ6 .ms-WPTitle {color: red}

This will now only style that specific web part.


You need to define some custom CSS that your page can make use of. If you are OK editing your page in SharePoint Designer then you need to add:

<style type="text/css">
     .ms-WPTitle {color: red}

This will usually go at the top of the page in the section. That should make the Title text on your web parts red. Assuming you get that far then you need to tweak the CSS to achieve the effect you would like.

share|improve this answer
I need even more basic instructions - so sorry!! I know how to edit the welcome page template in designer, but I don't know where to put the code ".ms-WPTitle {color: red}" to test that it works - here's my template: – April Drake May 28 '13 at 23:49
Eeeek - I have edited the response above to hopefully point you in the right direction but I would recommend reading up on CSS to get some clearer understanding of how it works. – Dave Paylor May 29 '13 at 9:15
thank you for the edit!! – April Drake May 29 '13 at 17:31

Jeez, it's been a very long time since I've even looked at XSLT but that's how you would style a Content Query Web Part. Microsoft's How-To is a decent starting point but there are years worth of blogs you can dig up that will provide better examples.

Another thing to consider is that Microsoft is phasing this technique out (which is why I can't provide a nice example link -- I've gotten rid of them all). It looks like you are using SharePoint 2010 but in SharePoint 2013 JavaScript Display Templates are king. I don't even think Microsoft recommends using CQWP anymore in SharePoint 2013. You may want to take that into consideration while building out your solution. You will be able to use your solution in SharePoint 2013 if you're using Content Query Web Parts but don't expect it to stick around for long looking into the future. Not sure what kind of resources you have but I would look into SharePoint 2013 rather than starting with SharePoint 2010.

share|improve this answer
Well we will not be moving to sharepoint 2013. It took us a year to build this out and we are going to be on it for a while. I just wanted a quick/easy way to make the titles more visible. – April Drake May 28 '13 at 23:54
I gotcha. Take a look at that primer and you should be able to find some samples online. The one benefit to using 2010 is that there are years of information out there on the web and everyone has done nearly everything they could with the platform. – EHorodyski May 29 '13 at 12:41

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.