Home
Our Work
Services
Small Business Intranet
Samples
Training
SharePoint
Hosting
    

dbWeb > Blogs > Brandt Fuchs > Posts > Custom Styles in Rich Text Editor for Content Editor Web Parts

 Custom Styles in Rich Text Editor for Content Editor Web Parts
I found a couple of web sites that have this information, but they have a lot more on them so I figured I'd cut to the chase. Site 1, Site 2

The Rich Text Editor field control will detect all CSS classes defined on the page that match a specific naming pattern and display them in the Styles selector in the toolbar of the field control. Any style with the class name containing the prefix of ms-rteCustom- is added to the list of possible CSS classes to choose from. The field control is intelligent enough to only display the classes that are available based on the context of the editor.

So in short, if I add

.ms-rteCustom-Header{ font-family:verdana; font-size:12pt; color:#1C649E; }

to any of my stylesheets (core.css will always work), when I select some text in a RTE and then select styles from the RTE toolbar, I will see Header as an option and it will apply the style listed above.

This is a great way to maintain consistency across an entire site collection, rather than have every end user specify a font, size, and color for each piece of content.

Comments

There are no comments yet for this post.