line-clamp-012.tentative.html (863B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS Overflow: when clamping by lines, borders and padding are respected</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-012-ref.html"> 7 <meta name="assert" content="when line-clamp is used with a number of lines, the box and its clamped children should be sized respecting borders and padding"> 8 <style> 9 .clamp { 10 line-clamp: 4; 11 font: 16px / 32px serif; 12 padding: 4px; 13 white-space: pre; 14 background-color: yellow; 15 border: 2px solid black; 16 } 17 .inner { 18 background-color: skyblue; 19 padding: 4px; 20 border: 2px solid purple; 21 } 22 </style> 23 <div class="clamp">Line 1 24 Line 2<div class="inner">Line 3 25 Line 4 26 Line 5 27 Line 6</div></div> 28 <p>Following content.</p>