/* Keyword value */
line-clamp: none;
/* <integer> value only */
line-clamp: 3;
line-clamp: 10;
/* <integer> and <'block-ellipsis'> values */
line-clamp: 3 no-ellipsis;
line-clamp: 10 "… (there is extra content)";
/* <'block-ellipsis'> value only */
line-clamp: no-ellipsis;
line-clamp: "… (there is extra content)";
/* Global values */
line-clamp: inherit;
line-clamp: initial;
line-clamp: revert;
line-clamp: revert-layer;
line-clamp: unset;`line-clamp` CSS property / notebook
`line-clamp` CSS property
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
<section>
<div class="card">
<h2>number of lines</h2>
<p class="integer">
In this card, the <em>number of lines</em> is specified by an
<code><integer></code>. Any content that does not fit is truncated
and an ellipsis is shown.
</p>
</div>
<div class="card">
<h2>no ellipsis</h2>
<p class="no-ellipsis">
In this card, an <code><integer></code> and a
<em>no-ellipsis</em> value are specified. Any content that does not fit is
truncated and no ellipsis is shown.
</p>
</div>
<div class="card">
<h2>custom string</h2>
<p class="string">
In this card, an <code><integer></code> and a <em>string</em> value
are specified. Any content that does not fit is truncated and the custom
string is shown instead of an ellipsis.
</p>
</div>
</section>