How to change default font size in tinymce?

I have used in my project in this way

tinymce.init({
  selector:"#txt1",
  setup : function(ed)
  {
    ed.on('init', function() 
    {
        this.execCommand("fontName", false, "tahoma");
        this.execCommand("fontSize", false, "12px");
    });
  }  
}); 

This is the better way than just changing property values in 'content.css'


You need to use the content_css setting of tinymce to set a custom css file of your own (make sure this setting points to a valid location of a css file). This file will be inserted in the editor iframes head after all other css settings(files from the core) are inserted there when initialising tinymce - thus all settings you place in your file will overwrite the settings made before (by tinymce).

Example: Setting the default font-size to 11px. Content of a custom css file (i named it content.css in my installation):

body {
    font-family: Verdana,Arial,Helvetica,sans-serif;
    font-size: 11px;
}

How to use this setting:

tinyMCE.init({
 ...
 // you do not need to include it yourself, tinymce will do this for you, 
 // but you will need to give tinymce the location of your css file
 content_css : "http://www.myserver.com/css/content.css", 
     ...
});

Just add this line to the options

content_style: ".mce-content-body {font-size:15px;font-family:Arial,sans-serif;}",

so it looks like this

tinymce.init({
    selector: "textarea",theme: "modern",width: '100%',min_height:350 ,menubar:false,
     content_style: ".mce-content-body {font-size:15px;font-family:Arial,sans-serif;}",
    browser_spellcheck : true,
    plugins: 
    [
         "advlist autolink link image lists charmap print preview hr anchor pagebreak",
         "searchreplace wordcount visualblocks visualchars insertdatetime media nonbreaking",
         "table contextmenu directionality emoticons paste textcolor responsivefilemanager code"
    ],
   toolbar1: " undo redo preview code | \n\
                 link  bold italic underline | hr | image responsivefilemanager media |unlink anchor  | ",
   image_advtab: true ,

   external_filemanager_path:"/tinymce/filemanager/",
   filemanager_title:"Responsive Filemanager" ,
   relative_urls: false,
    remove_script_host : false,
   external_plugins: { "filemanager" : "/tinymce/filemanager/plugin.min.js"}
 });