line-clamp-auto-025.html (1062B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS Overflow: abspos exactly at the clamp point is hidden</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-025-ref.html"> 7 <meta name="assert" content="The chosen clamp point with line-clamp: auto is after the last line or box where the box size doesn't overflow. If the clamp point follows a box, then no line has an ellipsis. However, only in-flow boxes count, so an abspos doesn't prevent a previous line from having the ellipsis."> 8 <style> 9 .clamp { 10 line-clamp: auto; 11 max-height: 4lh; 12 font: 16px / 32px serif; 13 padding: 0 4px; 14 background-color: yellow; 15 } 16 .inner { 17 white-space: pre-wrap; 18 } 19 .abspos { 20 position: absolute; 21 width: 100px; 22 height: 100px; 23 background-color: skyblue; 24 } 25 </style> 26 <div class="clamp"> 27 <div class="inner">Line 1 28 Line 2 29 Line 3 30 Line 4 31 </div> 32 <div class="abspos"></div> 33 <div class="inner">Line 5 34 Line 6</div> 35 </div>