1

I'm working with this jsfiddle. I would like the <p>Super long words here</p> to look like Super lon... instead of showing the full text. I tried adding

white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;

But it didn't work. How can I get my overflow text to end in an ellipsis?

1 Answer 1

2

You have to specify a width to achieve this effect, like this:

.pClass p {
    margin: 0 !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width:20px;
}

Fiddle

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.