line-clamp-auto-019.tentative.html (873B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS Overflow: `line-clamp: auto` with the clamp point in a descendant with bp</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-019-ref.html"> 7 <meta name="assert" content="If line-clamp: auto has the clamp point in a descendant, it should take its border and padding into account"> 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 } 16 .clamp > div { 17 /* The total block-size bp across the top and bottom is 2*(14+2) = 32px, same as the line-height */ 18 padding: 14px; 19 border: 2px solid black; 20 } 21 </style> 22 <div class="clamp"><div>Line 1 23 Line 2 24 Line 3 25 Line 4 26 Line 5 27 Line 6</div></div>