line-clamp-036.html (1112B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS Overflow: `line-clamp` with only lineless content after clamp</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="/css/reference/ref-filled-green-100px-square.xht"> 7 <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> 8 <meta name="assert" content="If there is content after the clamp point, but it has no lines (e.g. lineless blocks or IFCs), the line-clamp container will still clamp."> 9 <style> 10 .clamp { 11 line-clamp: 4; 12 font: 25px/1 Ahem; 13 } 14 .green { 15 color: green; 16 } 17 .red { 18 background-color: red; 19 } 20 .lineless { 21 height: 1lh; 22 } 23 .ifc { 24 display: flow-root; 25 } 26 </style> 27 <p>Test passes if there is a filled green square and <strong>no red</strong>.</p> 28 <div class="clamp"> 29 <div class="green"> 30 PASS<br> 31 PASS<br> 32 PASS<br> 33 PAS<br> <!-- intentionally misspelled so the ellipsis doesn't stick out of the square --> 34 </div> 35 <div class="red lineless"></div> 36 <div class="red ifc">FAIL</div> 37 </div>