line-clamp-auto-029.tentative.html (787B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS Overflow: `line-clamp: auto` accounts for collapsing margins</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-029-ref.html"> 7 <meta name="assert" content="With `line-clamp: auto`, if a clamp point might fall inside a box, its margins are accounted for correctly, even if they collapse."> 8 <style> 9 .clamp { 10 line-clamp: auto; 11 max-height: 5lh; 12 font: 16px / 32px serif; 13 white-space: pre; 14 background-color: yellow; 15 margin: 4px; 16 } 17 .clamp div { 18 margin: 4px; 19 } 20 </style> 21 <div class="clamp"><div><div><div>Line 1 22 Line 2 23 Line 3 24 Line 4 25 Line 5 26 Line 6</div></div></div></div>