line-clamp-with-fixed-pos-016.html (1091B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS Overflow: line-clamp: auto hidden block-level fixed pos</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="Block-level fixed-pos should still be hidden if its fixed positioning containing block is after the clamp point with line-clamp: auto, even if it lies on the boundary because the automatic size of previous boxes was adjusted."> 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; 18 } 19 .transformed { 20 transform: scale(1); /* Makes it a fixed-pos containing block */ 21 } 22 .fixed { 23 position: fixed; 24 width: 100px; 25 height: 100px; 26 background-color: skyblue; 27 } 28 </style> 29 30 <div class="clamp"> 31 <div class="inner">Line 1 32 Line 2 33 Line 3 34 Line 4 35 Line 5 36 Line 6</div> 37 <div class="transformed"><div class="fixed"></div></div> 38 </div>