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-floats-016.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Overflow: a float in a line-clamp container does not make it taller</title>
<link rel="match" href="/css/reference/ref-filled-green-100px-square.xht">
<meta name="assert" content="Floats in a line-clamp container do not introduce any clearance that would make the line-clamp container increase its height, even when there's no clamp point because there are fewer lines than specified.">
<link rel="stylesheet" href="/fonts/ahem.css">
<style>
.clamp {
line-clamp: 3;
font: 50px / 1 Ahem;
color: transparent;
width: 100px;
background-color: green;
}
.float {
float: left;
width: 10px;
height: 200px;
}
</style>
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<div style="background-color: red; width: 100px; height: 100px; position: absolute; z-index: -1"></div>
<div class="clamp"><div class="float"></div>X<br>X</div>