inline.html 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0" />
  6. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.4.0/css/font-awesome.min.css">
  7. <link rel="stylesheet" href="../../css/froala_editor.css">
  8. <link rel="stylesheet" href="../../css/froala_style.css">
  9. <style>
  10. body {
  11. text-align: center;
  12. }
  13. section {
  14. width: 81%;
  15. margin: auto;
  16. text-align: left;
  17. }
  18. </style>
  19. </head>
  20. <body>
  21. <section id="editor">
  22. <div id='edit' style="margin-top: 30px;">
  23. <h1>Inline Styles</h1>
  24. <p>Using the <code>inline_style.min.js</code> plugin it is possible to add custom style on the selected text
  25. inside the WYSIWYG HTML editor.</p>
  26. <p>Use the Inline Style dropdown to select the desired inline style for the selected text inside the rich text
  27. editor.</p>
  28. <p>Make sure that the <code>inlineStyle</code> button is included in the <a
  29. href="https://www.froala.com/wysiwyg-editor/docs/options#toolbarButtons"
  30. title="toolbarButtons">toolbarButtons</a> list. By default the inlineStyle button is already in the list, but
  31. if you changed the buttons list just make sure you don't omit the inlineStyle button.</p>
  32. <p>You can define your own inline styles using the <a
  33. href="https://www.froala.com/wysiwyg-editor/docs/options#inlineStyles" title="inlineStyles">inlineStyles</a>
  34. option. This option is an Object where the key of each property represents the name of the new style and its
  35. value specifies the CSS properties for it. It is important to have unique names for the styles or they will not
  36. work properly.</p>
  37. </div>
  38. </section>
  39. <script type="text/javascript" src="../../js/froala_editor.min.js"></script>
  40. <script type="text/javascript" src="../../js/plugins/link.min.js"></script>
  41. <script type="text/javascript" src="../../js/plugins/inline_style.min.js"></script>
  42. <script>
  43. (function () {
  44. new FroalaEditor("#edit", {
  45. toolbarButtons: [ ['bold', 'italic', 'underline', 'strikeThrough'], ['inlineStyle', 'undo', 'redo'] ],
  46. // Define new inline styles.
  47. inlineStyles: {
  48. 'Big Red': 'font-size: 20px; color: red;',
  49. 'Small Blue': 'font-size: 14px; color: blue;'
  50. }
  51. })
  52. })()
  53. </script>
  54. </body>
  55. </html>