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.