CSS3 text-overflow Property

Example

Use of the text-overflow property:

div.test
{
text-overflow:ellipsis;
}

Try it yourself »
More examples at the bottom of this page.

Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The text-overflow property is supported in all major browsers.


Definition and Usage

The text-overflow property specifies what should happen when text overflows the containing element.

Default value: clip
Inherited: no
Version: CSS3
JavaScript syntax: object.style.textOverflow="ellipses"


Syntax

text-overflow: clip|ellipsis|string;

Value Description
clip Clips the text
ellipsis Render an ellipsis ("...") to represent clipped text
string Render the given string to represent clipped text


Examples

Try it Yourself - Examples

Text-overflow with a hover effect
This example demonstrates how to display the entire text when hover over the element.