CSS block-overflow Property

CSS block-overflow Property

CSS block-overflow Property

The block-overflow property in CSS controls how content overflows when it exceeds the block container's dimensions.

1. Syntax

selector { block-overflow: [clip | ellipsis | visible]; }

Accepted Values:

ValueDescription
clipCuts off overflowing content without adding an ellipsis (...).
ellipsisDisplays an ellipsis (...) when content overflows.
visibleAllows overflowing content to be fully displayed.

2. Example – Using block-overflow: ellipsis;

.box { width: 200px; height: 50px; block-overflow: ellipsis; overflow: hidden; display: block; white-space: nowrap; }
<div class="box"> This is a long text that will be truncated with an ellipsis when it overflows. </div>

✅ If the text is too long, it will end with "...".

3. Example – Using block-overflow: clip;

.box { width: 200px; height: 50px; block-overflow: clip; overflow: hidden; display: block; }

✅ This cuts off overflowing content without adding an ellipsis.

4. Example – Using block-overflow: visible;

.box { width: 200px; height: 50px; block-overflow: visible; display: block; }

✅ Overflowing text will still be visible beyond the element's boundaries.

5. Best Practices

✔ Use ellipsis for text truncation.
✔ Combine with overflow: hidden; for better clipping control.
✔ Use visible carefully to prevent unwanted overflow.

Soeng Souy

Soeng Souy

Website that learns and reads, PHP, Framework Laravel, How to and download Admin template sample source code free.

Post a Comment

CAN FEEDBACK
close