CSS text overflow

CSS text overflow is used when we want to show the content in the limited width or height.

CSS text overflow property handles the content when it is too large to show within the block.


Syntax

Output

This is the HTML paragraph inside the div to show text overflow property. This uses text overflow to handle the text within a block. This is the first paragraph.

This is the HTML paragraph inside the div to show text overflow property. This uses text overflow to handle the text within a block. This is the second paragraph.


CSS text overflow values list

Sr. No. value Description
1 clip Used to clip the text inside block. The value for this is clip.
2 ellipsis Used to ellipsis the text inside block. This puts “…” to the end of the text. The value for this is ellipsis.
3 initial Used to define as the property initial value.
4 inherit Used to define the computed value of property on the elements parent.
5 unset Used to define the property either acts as inherit or initial, depending on the property if it is inherited or not.