line-clamp-with-abspos-018.html (832B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS Overflow: line-clamp doesn't propagate to abspos</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-018-ref.html"> 7 <meta name="assert" content="Absolute positioned boxes create a new BFC, and line-clamp does not propagate into independent BFCs"> 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 .abspos { 17 position: absolute; 18 right: 0; 19 margin: 4px; 20 white-space: pre; 21 background-color: skyblue; 22 } 23 </style> 24 <div class="clamp">Line 1 25 Line 2 26 Line 3 27 Line 4<div class="abspos">Line A 28 Line B 29 Line C 30 Line D 31 Line E</div> 32 Line 5</div>