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-024.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Overflow: opacity ancestor applies to a visible abspos after the clamp point</title>
<link rel="match" href="reference/line-clamp-with-abspos-024-ref.html">
<meta name="assert" content="An abspos after the clamp remains visible if its containing block is visible, and opacity from its clamped inline ancestor still applies.">
<style>
.clamp {
line-clamp: 4;
font: 16px / 32px serif;
padding: 0 4px;
white-space: pre;
background-color: yellow;
position: relative;
}
.opacity {
opacity: 0.5;
}
.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
<span class="opacity"><span class="abspos"></span>Line 5</span></div>