Home > CSS > Display three dot ‘…’ in tail if text appears longer than container

Display three dot ‘…’ in tail if text appears longer than container


This is one of CSS trick I just found out to display three dot if the text size is longer than its container.

The following attributes must be set in order to work

#id_three_dot {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

Cheers,
Pete Houston

Advertisements
Categories: CSS Tags: , , ,
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: