Can I set a column break in a CSS multicolumn layout? Can I set a column break in a CSS multicolumn layout? javascript javascript

Can I set a column break in a CSS multicolumn layout?


5. Column breaks

When content is laid out in multiple columns, the user agent must determine where column breaks are placed. The problem of breaking content into columns is similar to breaking content into pages.

Three new properties are introduced to allow column breaks to be described in the same properties as page breaks: ‘break-before’, ‘break-after’, and ‘break-inside’. These properties take the same values as ‘page-break-before’, ‘page-break-after’, and ‘page-break-inside’ [CSS21]. In addition, some new keyword values are added.

These properties describe page/column break behavior before/after/inside the generated box. These values are normatively defined in [CSS21]:

  • auto: Neither force nor forbid a page/column break before (after, inside) the generated box.
  • always: Always force a page break before (after) the generated box.
  • avoid: Avoid a page/column break before (after, inside) the generated box.
  • left: Force one or two page breaks before (after) the generated box so that the next page is formatted as a left page.
  • right: Force one or two page breaks before (after) the generated box so that the next page is formatted as a right page.

This specification adds the following new values:

  • page: Always force a page break before (after) the generated box.
  • column: Always force a column break before (after) the generated box.
  • avoid-page: Avoid a page break before (after, inside) the generated box.
  • avoid-column: Avoid a column break before (after, inside) the generated box.

Therefore, you could use something like

#multicolumn {  -webkit-column-count: 2; /* Chrome, Safari, Opera */  -moz-column-count: 2; /* Firefox */  column-count: 2;}.column {  break-before: column;  break-after: column;}
<div id="multicolumn">  <div class="column">FIRST paragraph orem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam.</div>  <div class="column">SECOND paragraph Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum.</div></div>