CSS διακοπή μετά ιδιότητα

Ορισμός και χρήση

Η ιδιότητα break-after καθορίζει αν πρέπει να συμβεί διάσπαση σελίδας (page-break), διάσπαση στήλης (column-break) ή διάσπαση περιοχής (region-break) μετά από το καθορισμένο στοιχείο.

Η ιδιότητα break-after επεκτείνει την ιδιότητα page-break-after του CSS2.

Με τη χρήση της τιμής break-after, μπορείτε να ενημερώσετε τον περιηγητή να διακόψει την σελίδα, τη στήλη ή την περιοχή μετά από το στοιχείο που έχει την ιδιότητα break-after, ή να αποφύγει τη διάσπαση του στοιχείου και να μην διαχωρίζεται σε δύο σελίδες.

Example

Always insert a page break before the <footer> element.

@media print {
  footer {
    break-after: always;
  }
}

CSS syntax

break-after: auto|all|always|avoid|avoid-column|avoid-page|avoid-region|column|left|page|recto|region|right|verso|initial|inherit;

Property value

Value Description
auto Default. Automatically paginate, columnize, and partition after the element.
all Always insert a page break immediately after the main box.
always Always insert a page break after the element.
avoid Avoid page, column, or region breaks after the element.
avoid-column Avoid columning after the element.
avoid-page Avoid paging after the element.
avoid-region Avoid partitioning after the element.
column Always insert a column break after the element.
left Insert one or two page breaks after the element to format the next page as a left page.
page Always insert a page break after the element.
recto Insert one or two page breaks after the main box to format the next page as a recto page.
region Always insert a separator after the element.
right Insert one or two page breaks after the element to format the next page as a right page.
verso Insert one or two page breaks after the main box to format the next page as a verso page.
initial Set this property to its default value. See initial.
inherit Inherit this property from its parent element. See inherit.

Technical details

Default value: auto
Inheritance: No
Animation production: Not supported. See:Animation-related properties.
Version: CSS3
JavaScript syntax: object.style.breakAfter="always"

More examples

Example

Always insert a page break after the element with id "toc":

@media print {
  #toc {
    break-after: always;
  }
}

Example

Always insert a separator after the <ul> element within a certain region:

.region ul {
    break-after: region;
  }
}

Browser support

The numbers in the table indicate the first browser version that fully supports this property.

Chrome IE / Edge Firefox Safari Opera
50.0 10.0 65.0 10.0 37.0