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-038.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Overflow: a phantom line box after the last non-phantom line box in a container doesn't introduce a clamp point</title>
<link rel="author" title="Andreu Botella" href="mailto:abotella@igalia.com">
<link rel="match" href="reference/webkit-line-clamp-001-ref.html">
<meta name="assert" content="Phantom line boxes are defined to be treated as not existing for any layout or rendering purpose other than determining the positions of any descendant, so if a regular line box is followed by a phantom line box, there's not a clamp point between them. This is also the case if the phantom line box is created as a result of block-in-inline splitting.">
<style>
.clamp {
line-clamp: 5;
font: 16px / 32px serif;
background-color: yellow;
}
.clamp p {
margin: 0;
}
</style>
<div class="clamp">
<span>
<div>
<p>Line 1</p>
<p>Line 2</p>
<p>Line 3</p>
<p>Line 4</p>
<p>Line 5</p>
</div>
</span>
</div>