line-clamp-auto-015.tentative.html (841B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS Overflow: floats pushing a line downwards</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/webkit-line-clamp-005-ref.html"> 7 <meta name="assert" content="If a float pushes a line downwards past the clamp point, the float and the line will both be hidden."> 8 <style> 9 .parent { 10 padding: 0 4px; 11 background-color: yellow; 12 } 13 .clamp { 14 line-clamp: auto; 15 max-height: 5lh; 16 font: 16px / 32px serif; 17 white-space: pre-wrap; 18 width: 200px; 19 } 20 .float { 21 float: left; 22 width: 300px; 23 background-color: orange; 24 } 25 </style> 26 <div class="parent"> 27 <div class="clamp">Line 1 28 Line 2 29 Line 3 30 Line 4 31 <div class="float">Float</div>Line 5 32 Line 6</div> 33 </div>