As a CMS system, it's obviously necessary to apply standard styles to all content, so the whole site looks consistent.
This rule outlines how to use custom styles in the SharePoint RichHTMLEditor.
In SharePoint, we can use the below way to apply custom styles:
Figure: custom RichHtmlEditor styles give your content editors a visual preview of your custom styles
To do this:
<SSW:ParsedRichHtmlField **PrefixStyleSheet="ssw15-rte"** CssClass="ssw-inputeditorfield" id="Content" FieldName="PublishingPageContent" InputFieldLabel="Rule Summary Info" runat="server"/>
<SharePointWebControls:CssRegistration ID="CssRegistration3" Name=" **Themable/ssw.core.styles.v15.css** " runat="server" EnableCssTheming="True"/>
<PublishingWebControls:EditModePanel ID="EditModePanel1" runat="server"><!-- Styles for edit mode only--><SharePointWebControls:CssRegistration ID="CssRegistration2" name="<% $SPUrl:~sitecollection/Style Library/~language/Themable/Core Styles/editmode15.css %>"After="<% $SPUrl:~sitecollection/Style Library/~language/Themable/Core Styles/pagelayouts15.css >" runat="server"/><SharePointWebControls:CssRegistration ID="CssRegistration3" Name=" **Themable/ssw.core.styles.v15.css** " runat="server" EnableCssTheming="True"After="<%$SPUrl:~sitecollection/Style Library/~language/Themable/Core Styles/ **editmode15.css** >" /></PublishingWebControls:EditModePanel>
Use " After " property to ensure that it will be loaded after the " editmode15.css ", which is SharePoint default edit mode style. The custom style css file will be applied to the ribbon after users change to edit mode.
.ssw15-rteLanguage-en {-ms-name: English;}
P.ssw15-rteElement-CodeArea{-ms-name:"Code Area";border: solid #CCC;border-width: 1px 1px 1px 10px;background: #EEE;padding: 5px 10px;margin: 8px;overflow-x:auto;display:block;width:93%;font-size:12px;}
This Code Area style will come up in "Page Elements" section:
, you may have to do that via changing html source code manually, or creating a "combined" "Text Styles".
.ssw15-rte **Table-** default{<-ms-name:"SSW Table";border:1px solid #ddd;margin: 8px;width:98%;background-color:#f0f0f0;}
After finishing the definitions of custom styles, make a package and deploy to a SharePoint site, Create a page using the page layout or master page which you added custom RichHtmlField style, then you should be able to see the custom styles in the ribbon.