【问题标题】:How to set inline style at RadEditor control's body element如何在 RadEditor 控件的 body 元素中设置内联样式
【发布时间】:2014-09-05 11:16:02
【问题描述】:

我想在 Telerik 的 Radeditor 的 body 元素中设置内联样式,但我想在没有官方解决方案 radeditor css 文件的情况下执行此操作。

例如,我希望编辑器的主体在编辑器初始化时具有内联字体系列。

出于我的目的,它应该是内联样式。我使用 radeditor 作为电子邮件编辑器,因此正文将通过消毒提供商。

任何来自客户端或来自代码隐藏 C# 的解决方案都会有所帮助。

提前致谢。

【问题讨论】:

    标签: c# jquery html css radeditor


    【解决方案1】:

    这是一个关于如何在客户端获取对内容区域的引用的示例:

    <telerik:RadEditor
       ID="RadEditor1"
       OnClientLoad="OnClientLoad"
       runat="server">
    </telerik:RadEditor>
    ...
    <script type="text/javascript">
        function OnClientLoad(editor, args) {
            var style = editor.get_contentArea().style;
            style.backgroundImage = "none";
            style.backgroundColor = "black";
            style.color = "red";
            style.fontFamily = "Arial";
            style.fontSize = 15 + "px";
        }
    </script>
    

    【讨论】:

      猜你喜欢
      • 2011-12-26
      • 2013-12-29
      • 1970-01-01
      • 2021-09-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-11-08
      相关资源
      最近更新 更多