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-016.tentative.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Overflow: floats pushing a line downwards</title>
<link rel="author" title="Andreu Botella" href="mailto:abotella@igalia.com">
<link rel="match" href="reference/line-clamp-auto-016-ref.html">
<meta name="assert" content="The last line before clamp should have an ellipsis, even if it's only the last line because it is pushed down by a float">
<style>
.parent {
padding: 0 4px;
background-color: yellow;
}
.clamp {
line-clamp: auto;
max-height: 5lh;
font: 16px / 32px serif;
white-space: pre-wrap;
width: 200px;
}
.float {
float: left;
width: 300px;
background-color: orange;
}
</style>
<div class="parent">
<div class="clamp">Line 1
Line 2
Line 3
<div class="float">Float</div>Line 4
Line 5
Line 6</div>
</div>