none
How can you modify style of Title on Content Query Web Part

    Question

  • I've created a custom style in the  ItemsStyle.xsl which works great for the query results. What I want to do is change the font/color of the Chrome 'Title Only'. default grabs <h3 class="ms-standardheader ms-WPTitle"> from core.css but where is the code which does that? Can I change it so it uses a custom class?

    Thanks

    Wednesday, December 10, 2008 8:50 PM

Answers

  • The approach I've used in the past when branding sites is to add a custom CSS file and do all the custom branding there. Include the CSS file in your master page after the core.css, and add a rule like this:

    1h3.ms-WPTitle { 
    2  /* fill in custom style here */ 
    3


    This will override all web part titles, though - are you saying you want to customize the title for only this particular CQWP?

    Peter Mularien
    Edgewater Technology, Inc. / Systems Architect / Java, Ruby on Rails, Sharepoint, Websphere
    Thursday, December 11, 2008 2:13 PM
  •  

    Hi,

    If you want to apply the custom style only in a web part, I think you can overwrite the CSS style “.ms-WPTitle” in your web part page using SharePoint Designer, the code looks like:


    <asp:Content ContentPlaceHolderId="PlaceHolderPageTitleInTitleArea" runat="server" > 
     
    <SharePoint:ListProperty Property="Title" runat="server" CssClass="ms-WPTitle" /> 
     
    <style type="text/css" > 
     
    .ms-WPTitle{   }  
     
    </style> 
     
    </asp:Content> 
     
     


    For more information about CSS reference for SharePoint, please refer to: http://www.heathersolomon.com/content/sp07cssreference.htm#WebParts


    Xue-Mei Chang
    Friday, December 12, 2008 5:49 AM

All replies

  • The approach I've used in the past when branding sites is to add a custom CSS file and do all the custom branding there. Include the CSS file in your master page after the core.css, and add a rule like this:

    1h3.ms-WPTitle { 
    2  /* fill in custom style here */ 
    3


    This will override all web part titles, though - are you saying you want to customize the title for only this particular CQWP?

    Peter Mularien
    Edgewater Technology, Inc. / Systems Architect / Java, Ruby on Rails, Sharepoint, Websphere
    Thursday, December 11, 2008 2:13 PM
  •  

    Hi,

    If you want to apply the custom style only in a web part, I think you can overwrite the CSS style “.ms-WPTitle” in your web part page using SharePoint Designer, the code looks like:


    <asp:Content ContentPlaceHolderId="PlaceHolderPageTitleInTitleArea" runat="server" > 
     
    <SharePoint:ListProperty Property="Title" runat="server" CssClass="ms-WPTitle" /> 
     
    <style type="text/css" > 
     
    .ms-WPTitle{   }  
     
    </style> 
     
    </asp:Content> 
     
     


    For more information about CSS reference for SharePoint, please refer to: http://www.heathersolomon.com/content/sp07cssreference.htm#WebParts


    Xue-Mei Chang
    Friday, December 12, 2008 5:49 AM