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/block-ellipsis-045.tentative.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Overflow: Space behavior when characters are removed off the end</title>
<link rel="author" title="Andreu Botella" href="mailto:abotella@igalia.com">
<link rel="match" href="/css/reference/ref-filled-green-100px-square.xht">
<link rel="stylesheet" href="/fonts/ahem.css">
<meta name="assert" content="If there are no possible soft wrap opportunities after which the block-ellipsis could be placed so that it fits in the line without overflowing, then characters are removed off the end of the line until it fits. If the last character is a non-collapsible space, it does not get trimmed.">
<style>
.rel {
position: relative;
font-family: Ahem;
line-height: 1;
font-size: 25px;
}
.bg {
position: absolute;
top: 0;
left: 0;
width: 100px;
color: red;
}
.test {
position: absolute;
top: 0;
left: 0;
width: 100px;
line-clamp: 4;
color: green;
white-space: pre;
}
.red { color: red; }
.green { color: green; }
</style>
<p>Test passes if there is a filled green square and <strong>no red</strong>.
<div class="rel">
<div class="bg">
XXXX
XXXX
XXXX
X<span class="green">XX</span>X
</div>
<div class="test">XXXX
XXXX
XXXX
X <span class="red">X
XXXX</span></div>
</div>