The max-lines property forces a fragment to break after a specified number of lines. This forces a break after the given number of lines contained within the element or its descendants, as long as those lines are in the same block formatting context.

  • Initial valuenone
  • Applies toFragment boxes
  • InheritedNo
  • MediaVisual
  • Computed valueSpecified value
  • AnimatableNo
  • CSS VersionCSS3
  • JavaScript
Formal syntax: none | <integer> 
  • noneBreaks occur only as specified elsewhere.
  • <integer>In addition to any breaks specified elsewhere, a break is forced before any line that would exceed the given number of lines being placed inside the element. Only positive numbers are allowed.
.class {
   max-lines: 3;

Last updated on 23rd March 2014 By Rene Spronk

View All CSS Properties

Errors? Please help to keep this list up to date, If you find any errors, please contact us, so that we can get them fixed.