Friday, September 19, 2008

Creating Custom WCM Styles

When creating content on a publishing site through a Page Content HTML editor there are some basic styles that come OOTB: The styles are actually conditional and different styles appear based on the type of content selected.


  • Article By Line
  • Article Head Line
  • Article Title



  • Square Bullet List (Only for un-numbered lists)

  • Roman Number List (Only for numbered lists)


  • Link Style

You can view the OOTB styles by going to "http://yourportalsite/_layouts/1033/styles/HtmlEditorCustomStyles.css"

There is also the option of using the paragraph formatting dropdown to style your content.

So how do you create your own custom styles?

  1. First you will have to create your own custom CSS file.
  2. Then you need to know how to classify your content. Use the following attribute in your custom CSS without the quotes of course. Replace the "yourstylename" with your own custom style name without spaces.
    1. Images: ""
    2. Links: ""
    3. Numbered Lists: ""
    4. Un-Numbered Lists: ""
    5. Basic text: ".ms-rteCustom-yourstylename"
  3. Note: If you are creating completely new styles they will override the OOTB styles and the examples above will not show. So if you like some of the OOTB style simply copy them over to your new CSS file.
  4. Upload your stylesheet to either the server or a document library, and under site settings set it as an alternate style sheet. Or you could add it to the bottom the core.css file so that it is available globally across all sites.

And that's about it! Good luck styling and let me know if you found this useful!

1 comment:

MeMoNoNo said...

This is great. Many thanks for the help.