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-auto-037.tentative.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Overflow: `line-clamp: auto` with non-zero max-height that doesn't fit any content</title>
<link rel="author" title="Andreu Botella" href="mailto:abotella@igalia.com">
<link rel="match" href="reference/line-clamp-auto-037-ref.html">
<meta name="assert" content="When line-clamp: auto is used with a max-height that isn't enough for any contained boxes or line boxes, then it should not show any content and its content box's intrinsic size should be zero">
<style>
.clamp {
line-clamp: auto;
max-height: 0.5lh;
font: 16px / 32px serif;
white-space: pre;
background-color: yellow;
border: 1px solid black;
padding: 4px;
}
</style>
<div class="clamp">Line 1
Line 2
Line 3
Line 4</div>
<p>Following content.</p>