• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.5 Using CSS, how to trim Thread Title after a certain length with "..."

Neutral Singh

Well-known member
#1
Say after like 35 characters, the title display is replaced by ... at the end of the title. How?

I guess, this css needs some modifications...

HTML:
.discussionListItem .title {
  font-size: 10.5pt;
  word-wrap: break-word;
}
i tried putting this in above CSS but it did not work....

HTML:
text-overflow: ellipsis;
max-width: 100%;
display: block;
overflow: hidden;
 

Brogan

XenForo moderator
Staff member
#2
The ellipsis will be applied for the overflow condition.

If you want to trim the title to 35 characters and automatically apply ellipsis, you can use the wordtrim helper, like so:
HTML:
{xen:helper wordtrim, $thread.title, 35}