Source code

Revision control

Copy as Markdown

Other Tools

<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<title>CSS test: balancing and line-clamp with lines before the paragraph</title>
<link rel='author' title='Christian Biesinger' href='mailto:cbiesinger@igalia.com'>
<meta name="assert" content="If the element is affected by line-clamp, the clamping effect is applied first, then the remaining lines are balanced. Lines of the line-clamp container before the balanced paragraph count towards the clamp.">
<style>
div {
border: solid;
font-family: monospace;
margin: 1ch;
width: 9.1ch; /* .1ch to work around browser bugs */
}
p {
margin: 0;
}
.test {
border-color: blue;
}
.test p + p {
}
.ref {
border-color: orange;
}
</style>
<p>Test passes if the box with a blue frame is identical to the orange one.
<div class=test>A<br>1 2 3<br>4 5 6<br>7 8 9…</div>
<div class=ref>A<br>1 2 3<br>4 5 6<br>7 8 9…</div>