I'm beginner and I have a question. I would like that if my text is more than 5 characters, that it writes 5 characters + ... . It's for shortening a name in navbar if its too long, it causes bugs in my nav.
Here's an example of desired result:
My text: TheTest
output: TheTe...
I think I could do this with strlen()
but have no idea how to do this. Maybe with an overflow
?
I tried to do it with text-overflow: ellipsis;
but it didn't work either
Can you help me please ?