line-clamp-with-fixed-pos-007.html (1100B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS Overflow: fixed pos whose containing block is the line-clamp container gets painted</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-with-abspos-005-ref.html"> 7 <meta name="assert" content="Fixed positioned boxes in a line-clamp container are shown if and only if their fixed positioning containing block precedes or contains the clamp point. In this case, the containing block is the line-clamp container, so the fixed-pos gets shown, even if its static position is after the clamp point."> 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 transform: scale(1); /* Makes it a fixed-pos containing block */ 16 } 17 .fixed { 18 position: fixed; 19 top: 0; 20 left: 0; 21 width: 20px; 22 height: 20px; 23 background-color: skyblue; 24 } 25 </style> 26 <div class="clamp">Line 1 27 Line 2 28 Line 3 29 Line 4 30 <div class="fixed"></div>Line 5</div>