Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/css-overflow/line-clamp/line-clamp-with-abspos-026.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Overflow: clamped ancestor background of a visible abspos is hidden</title>
<link rel="match" href="reference/line-clamp-with-abspos-005-ref.html">
<meta name="assert" content="A clamped out ancestor does not paint its background or in-flow content while its abspos descendant remains visible when the line clamp container is its containing block.">
<style>
.clamp {
line-clamp: 4;
font: 16px / 32px serif;
padding: 0 4px;
white-space: pre;
background-color: yellow;
position: relative;
}
.background {
background-color: red;
}
.abspos {
position: absolute;
top: 0;
left: 0;
width: 20px;
height: 20px;
background-color: skyblue;
}
</style>
<div class="clamp">Line 1
Line 2
Line 3
Line 4
<div class="background">Line 5<div class="abspos"></div></div></div>