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.valueDescription
1clipUsed to clip the text inside block. The value for this is clip.
2ellipsisUsed to ellipsis the text inside block. This puts “…” to the end of the text. The value for this is ellipsis.
3initialUsed to define as the property initial value.
4inheritUsed to define the computed value of property on the elements parent.
5unsetUsed to define the property either acts as inherit or initial, depending on the property if it is inherited or not.

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.