line-clamp-with-abspos-022.html (1030B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS Overflow: abspos in line-clamp after clamp point</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="Absolute positioned boxes inside a line-clamp container are always hidden if their containing block is after the clamp point. This test specifically tests that this is the case even when they don't have a set height."> 8 <style> 9 .clamp { 10 line-clamp: 4; 11 font: 16px / 32px serif; 12 padding: 0 4px; 13 white-space: pre; 14 background-color: yellow; 15 } 16 .rel { 17 position: relative; 18 } 19 .abspos { 20 position: absolute; 21 right: 0; 22 width: 100px; 23 /* No height! */ 24 margin: 4px; 25 white-space: normal; 26 background-color: red; 27 } 28 </style> 29 <div class="clamp">Line 1 30 Line 2 31 Line 3 32 Line 4 33 <div class="rel"><div class="abspos">This abspos shouldn't be visible</div>Line 5</div></div>