sharepointsharepoint-2010sharepoint-2007content-editor

Sharepoint 2010. Add custom background and frame for content editor webpart


I need to create custom webpart with complex (few divs, or other html elements) background and borders.

How can i use default sharepoint content editor and just add predefined background and frame!?

Thanks.


Solution

  • You tagged your question with Sharepoint 2007 and 2010, the content editors are different though. This answer is for SP2010:

    You can just add CSS to a custom CSS file. background-image for .ms-rte-layoutzone-inner-editable will do the image trick. If you want to add a "frame" as in border, you can add border attributes to .ms-rte-layoutzone-outer and make it e.g. red.

    An example for a background image:

    .ms-rte-layoutzone-inner-editable {
        border-image: url(/PublishingImages/Mylogo.gif);
    }
    

    But please do your users a favor and don't include anything blinking or distracting to the content editor's background - if you wanna go for some very light grey or something like that it's OK.

    For MOSS2007 you need to check the specific styles you can override.