<div class='demo-dfree'>
  <div class="dfree-body mce-content-body" contenteditable="true" style="position: relative;" spellcheck="false">
    <h2>Select text to bring up the editor.
    </h2>
        <h3>The popup position is responsive - it adjusts to available space.
    </h3>
  </div>
</div>


.demo-dfree {
  position: relative;
  width: 690px;
  box-shadow: 0px 2px 8px 0px rgba(0, 0, 0, 0.2);
  text-align: left;
  color: #626262;
  font-size: 14px;
  padding: 20px;
  font-family: Arial;
  margin: 20vh auto;
  border-radius: 5px;
}
.demo-dfree *[contentEditable="true"] {
  outline: none;
}
.demo-dfree h1 {
  color: #1976D2;
  font-size: 2em;
}
.demo-dfree h2 {
  color: #1976D2;
  font-size: 2em;
}
.demo-dfree h3 {
  font-size: 1.5em;
  color: #403f42;
  color: inherit;
}
.demo-dfree h2,
.demo-dfree h3 {
  margin-bottom: 0px;
  margin-top: 0px;
  line-height: 40px;
}
.demo-dfree ul,
.demo-dfree ol {
  padding-left: 20px;
}
.demo-dfree ul {
  list-style: disc;
}
.demo-dfree ol {
  list-style: decimal;
}
.demo-dfree a {
  text-decoration: underline;
}
.demo-dfree textarea {
  display: none;
}
.demo-dfree .dfree-header {
  font-size: 2.4em;
  text-align: center;
  margin: 10px;
}
.demo-dfree .dfree-body {
  padding: 20px;
  padding-top: 0px;
}
.demo-dfree .dfree-body p {
  margin-bottom: 10px;
}
.demo-dfree .dfree-body blockquote {
  margin-left: 30px;
  padding-left: 10px;
  margin-right: 40px;
  font-style: italic;
  border-left: 1px solid #696969;
}
.demo-dfree .dfree-body a {
  text-decoration: underline;
}
.demo-dfree .dfree-body td,
.demo-dfree .dfree-body tr {
  border: 1px solid #696969;
}


var dfreeHeaderConfig = {
  selector: '.dfree-header',
  menubar: false,
  inline: true,
  toolbar: false,
  plugins: [ 'quickbars' ],
  quickbars_insert_toolbar: 'undo redo',
  quickbars_selection_toolbar: 'italic underline',
};

var dfreeBodyConfig = {
  selector: '.dfree-body',
  menubar: false,
  inline: true,
  plugins: [
    'autolink',
    'codesample',
    'link',
    'lists',
    'media',
    'powerpaste',
    'table',
    'image',
    'quickbars',
    'codesample',
    'help'
  ],
  toolbar: false,
  quickbars_insert_toolbar: 'quicktable image media codesample',
  quickbars_selection_toolbar: 'bold italic underline | formatselect | blockquote quicklink',
  contextmenu: 'undo redo | inserttable | cell row column deletetable | help',
  powerpaste_word_import: 'clean',
  powerpaste_html_import: 'clean',
};

tinymce.init(dfreeHeaderConfig);
tinymce.init(dfreeBodyConfig);
Run Pen

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. https://cdn.tiny.cloud/1/qagffr3pkuv17a8on1afax661irst1hbr4e6tbv888sz91jc/tinymce/5-stable/tinymce.min.js