简体   繁体   English

Django在tinymce中修复了字体大小

[英]django fixed fontsize in tinymce

I have used tinymce in my django project. 我在django项目中使用过tinymce。 In my base.html I have used it as 在我的base.html中,我将其用作

<script src="//tinymce.cachefly.net/4.1/tinymce.min.js"></script>
<script>
tinymce.init({selector:'textarea',
plugins: [
    "advlist autolink lists link image charmap print preview hr anchor pagebreak",
    "searchreplace wordcount visualblocks visualchars code fullscreen",
    "insertdatetime media nonbreaking save table contextmenu directionality",
    "emoticons template paste textcolor colorpicker textpattern"
],
theme: 'modern',
font_size: "20 px",
toolbar: "undo redo pastetext | styleselect | fontselect | fontsizeselect | forecolor backcolor"
});
</script>

I wanto to make the fixed font size in my editor because the dafault one is too small. 我想在编辑器中设置固定的字体大小,因为dafault字体太小。 From tinymce site I came to know that I should use content_css in order to make my fontsize fixed.. 从tinymce网站上,我知道应该使用content_css来固定字体大小。

My static directory is in the root directory inside which I have made a directory named css and inside that folder I have "content_css" 我的静态目录位于我创建了一个名为css的目录的根目录中,并且在该文件夹中,我具有“ content_css”

Now what can I put the directory for "content_css".. Should I do like content_css:"static/css/content.css". 现在,我该放置“ content_css”的目录了吗。我应该喜欢content_css:“ static / css / content.css”。 I guess its only for django not the tinymce.. Confused in giving directory for content_css.. Thanks in advance 我猜它只为django而不是tinymce ..混淆了content_css的目录..在此先感谢

I finally found an easy solution assuming you are also using django-tinymce plugin? 我终于找到了一个简单的解决方案,假设您还使用了django-tinymce插件?

Simply select the highcontract skin which does not include a font-size of 10px for the body. 只需选择不包含10px字体大小的主体的高收缩皮肤。 As a result the default font size of the outer (django) app applies. 因此,将应用外部(django)应用程序的默认字体大小。

'theme': 'advanced',
'skin': 'highcontrast',

Paul 保罗

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM