Welcome to MSDN Blogs Sign in | Join | Help

Wrapping Text in a SharePoint WebPart Title

An interesting bit of CSS formatting behavior that I ran across recently at a customer site. They wanted to be able to have long titles in some of their web parts, but it would always make the web part zone expand to fit the text rather than wrapping the text. It turns out that the web part zone puts the title in a <nobr> tag.  As anyone who has done it knows, overriding an out-of-box web part or using reflection to modify its behavior can get ugly fast.  Out of curiosity, I suggested they try a CSS class that modifies the style of the <nobr> tag using the white-space:normal style.  They tried:

.ms-standardheader nobr {
    white-space: normal;
}

 

and it worked. Now, this may not be news to all of you CSS gurus out there, but to me it was a surprise that you could override the behavior of a tag, not just override CSS styles. Useful information to keep in mind when branding a site and trying to wrestle web part html into submission.

Published Friday, April 25, 2008 6:29 PM by Valdon
Filed under: , ,

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# Links (4/27/2008) &laquo; Steve Pietrek - Everything SharePoint

# SharePoint Kaffeetasse #60

Tuesday, April 29, 2008 11:31 AM by SharePoint, SharePoint and stuff

TOPP-TIPP des Tages Tam Tam Euro 2008 European Championship Web Parts Ready for Download (free)! Tipps

# SharePoint Kaffeetasse #60

Tuesday, April 29, 2008 11:38 AM by Mirrored Blogs

TOPP-TIPP des Tages Tam Tam Euro 2008 European Championship Web Parts Ready for Download (free)! Tipps

Leave a Comment

(required) 
required 
(required) 

  
Enter Code Here: Required
 
Page view tracker