以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助]能否设置HTML编辑器的默认字体、字号  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=131150)

--  作者:天一生水
--  发布时间:2019/2/18 21:33:00
--  [求助]能否设置HTML编辑器的默认字体、字号
web浏览器打开HTML编辑器时,能否设置编辑器的默认字体、字号?
我在编辑器打开的网页代码中(下图的第48行)添加了样式,但不起作用,请老师看一下是什么原因?

图片点击可在新窗口打开查看此主题相关图片如下:截屏图片 (1).jpg
图片点击可在新窗口打开查看



--  作者:有点蓝
--  发布时间:2019/2/18 21:49:00
--  
https://www.baidu.com/baidu?word=html%20body%20设置字体

header区添加样式
<style type="text/css">body{font-size:1.1em;font-family:"幼圆","微软雅黑";}</style>

--  作者:天一生水
--  发布时间:2019/2/25 13:31:00
--  

老师好!

我试着把上述字体格式代码放入head部,也不行。

是不是不在e.html中设置?

 


图片点击可在新窗口打开查看此主题相关图片如下:360截图20190225132725740.jpg
图片点击可在新窗口打开查看

--  作者:有点甜
--  发布时间:2019/2/25 15:09:00
--  

红色代码

 

<!doctype html>
<html>
<head>
    <meta charset="utf-8" />
    <title>Html Editor</title>
    <script charset="utf-8" src="kindeditor.js"></script>
    <script charset="utf-8" src="lang/zh_CN.js"></script>


    <script>
        window.onerror = function () { return true; };
        var editor;
        var contentSeted = false;
        KindEditor.ready(function (K) {
            editor = K.create(\'#details\', {
cssData: \'body {font-family: "微软雅黑"; font-size: 24px}\',
                allowFileManager: false,
                allowImageUpload: false,
                resizeType: 0, //不能更改大小
                fullscreenMode: true,
                items: [
                \'undo\', \'redo\', \'|\', \'cut\', \'copy\', \'paste\',
                \'plainpaste\', \'wordpaste\', \'|\', \'justifyleft\', \'justifycenter\', \'justifyright\',
                \'justifyfull\', \'insertorderedlist\', \'insertunorderedlist\', \'indent\', \'outdent\', \'subscript\',
                \'superscript\', \'|\', \'clearhtml\', \'quickformat\', \'selectall\', \'flash\', \'table\', \'hr\', \'emoticons\', \'baidumap\', \'pagebreak\', \'/\',
                \'formatblock\', \'fontname\', \'fontsize\', \'|\', \'forecolor\', \'hilitecolor\', \'bold\',
                \'italic\', \'underline\', \'strikethrough\', \'lineheight\', \'removeformat\', \'|\', \'image\', \'multiimage\',

                 \'link\', \'unlink\', \'|\', \'template\', \'code\', \'source\', \'preview\',
],

                afterChange: function () {
                    if (editor && contentSeted)
                        window.external.RequestContent(editor.html());
                }
            });
            setContent(window.external.GetContent());

        });
        function setContent(content) {
            if (editor) {
                contentSeted = false;
                editor.html(content);
                contentSeted = true;
            }
        }

    </script>
</head>
<body style="padding: 0; margin: 0;">
 

<textarea id="details" style="display: block; width: 680px; height: 100%; visibility: hidden;"></textarea>

</body>
</html>