Source code

Revision control

Copy as Markdown

Other Tools

<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Overflow: line-clamp interaction with intrinsic size</title>
<link rel="author" title="Florian Rivoal" href="https://florian.rivoal.net/">
<link rel="match" href="reference/line-clamp-text-intrinsic-size-002-ref.html">
<meta name="assert" content="displacing content for the sake of inserting the block ellipsis does not change the min-content size">
<style>
.clamp {
line-clamp: 3;
}
.ref {
overflow: hidden;
height: 3lh;
}
div {
border: solid black 5px;
margin: 1em;
width: min-content;
color: transparent;
}
</style>
<p>Test passes if both boxes below are the same size.
<div class=ref>
short text<br>
medium text<br>
more text<br>
very_loooong_text<br>
</div>
<div class="clamp">
short text<br>
medium text<br>
more text<br>
very_loooong_text<br>
</div>