line-clamp-auto-036.html (1064B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS Overflow: `line-clamp: auto` clamp between two fixed-height blocks</title> 4 <link rel="author" title="Andreu Botella" href="mailto:abotella@igalia.com"> 5 <link rel="help" href="https://drafts.csswg.org/css-overflow-4/#line-clamp"> 6 <link rel="match" href="reference/line-clamp-auto-036-ref.html"> 7 <meta name="assert" content="With `line-clamp: auto`, there can be a clamp point between two fixed-height blocks. And when the clamp point immediately follows a block that ends with a line box, that line box is ellipsized, even if there is space between the end of the line box and the end of the parent block."> 8 <style> 9 .clamp { 10 line-clamp: auto; 11 max-height: 7lh; 12 font: 16px / 32px serif; 13 white-space: pre; 14 padding: 0 4px; 15 background-color: yellow; 16 } 17 .with-height { 18 height: 3lh; 19 background-color: orange; 20 } 21 .red { 22 background-color: red; 23 } 24 </style> 25 26 <div class="clamp">Line 1 27 Line 2 28 Line 3 29 Line 4 30 <div class="with-height">Line 5 31 Line 6</div><div class="with-height red">Line 7 32 Line 8</div>Line 9</div>