-2

i want to show ellipsis after some width.i want to do this with css. & only in one span tag.(no other tag should used label..etc). how can i achieve this.

<span>Name: Patrick Jonson</span>

output should be below one

Name: Patrick jon...

problem is that it break word when space appear.

Please help.

user2733745
  • 220
  • 2
  • 4
  • 13

1 Answers1

1

If I understand correctly...this is straightforward enough to accomplish-

Demo Fiddle

HTML

<span class='ellipsis'>Name: Patrick Jonson</span>

CSS

span.ellipsis{
    overflow:hidden;
    white-space:nowrap;
    text-overflow:ellipsis;
    width:130px;
    display:inline-block;
}
SW4
  • 69,876
  • 20
  • 132
  • 137