Docs › Blocks
Dividers and page breaks
Horizontal lines, six divider styles, and page breaks for printing.
Draw a line where the text changes topic, or make the next part start on a new page when printed.
Try it
Part 1
Thin line (the default).
Dashed.
Short line.
Code for this demo
createEditor('#editor', {
toolbar: 'bold | hr hrStyle pageBreak | undo redo',
});Dividers
The hr button inserts a plain <hr> at the caret. The hrStyle dropdown inserts one in a chosen style. On an empty line you can also type / and pick "Horizontal line".
| Value | Name | Saved style |
|---|---|---|
'thin' | Thin line | none (<hr>) |
'thick' | Thick line | border-top: 3px solid #adb5bd |
'dashed' | Dashed | border-top: 2px dashed #adb5bd |
'dotted' | Dotted | border-top: 3px dotted #adb5bd |
'double' | Double line | border-top: 4px double #adb5bd |
'short' | Short line | border-top: 2px solid #868e96; width: 64px; margin: 2em auto |
Every style except thin is saved inline together with border: 0, so it looks the same without your CSS. The thin line follows the browser’s or your site’s hr style.
Page breaks
pageBreak marks where printing (or saving as PDF) moves on to the next page. It is invisible on screen; while editing it shows as a dashed line labelled "PAGE BREAK". It is also in the / menu.
<div data-page-break="" style="page-break-after: always; break-after: page"></div>editor.exec('hr'); // plain divider
editor.exec('hr', 'dashed'); // thin | thick | dashed | dotted | double | short
editor.exec('pageBreak');Presets
The board and full presets put hrStyle under ⋯. pageBreak is only in full. No preset has the hr button.
Options
| Name | Type | Default | Description |
|---|---|---|---|
hr | toolbar item | - | Insert a plain divider |
hrStyle | toolbar item | - | Insert a divider in one of six styles |
pageBreak | toolbar item | - | Insert a page break for printing |