1

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.

Ievgen
  • 4,261
  • 7
  • 75
  • 124

1 Answers1

2

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.

Dennis G
  • 21,405
  • 19
  • 96
  • 133
  • Yes.. But "border" quite complex control. With title, effects and so on. So really need to make this control to be part of other. Or add snippets! Can i add snippets to content editor? – Ievgen Sep 22 '11 at 07:52
  • 1
    `border` is not complex. `border: 1px solid green !important;` draws a solid green border. Border is not even a control, it is a CSS property. What do you mean with snippets? Yes you can add custom CSS/Javascript to a Content Editor WebPart if it's that what you mean. – Dennis G Sep 22 '11 at 11:57
  • no. I mean i need to draw not a simple border but complex control instead. So this solution cannot be applied. – Ievgen Sep 22 '11 at 12:10
  • 1
    Then your question is misworded and you won't get many replies. You ask "how can I use the default content editor [...] and add background?". Also with your custom webpart you can add background and borders with CSS. Please provide more information about your problem so one can actually help you. – Dennis G Sep 22 '11 at 12:23