0

I want to display a long text inside fixed height & width of span element.

I have a text displaying current something like this inside span element

My Skill is
  Web 
Designing.

i have given him this CSS

span
{
    display:block;
    height:40px;
    width:90px;
    overflow:hidden;
    text-overflow:ellipsis;
}

it give me result like this

My Skill is
  Web 

but It is not my desired result. I want it to display something like this

My Skill is
  Web...

Is there any way to solve this problem..?? Thank you in advance..

2
  • 2
    try adding this property white-space: nowrap; Commented Sep 28, 2013 at 20:38
  • 2
    also, provide a fiddle next time.. Commented Sep 28, 2013 at 20:41

1 Answer 1

5

You need to add the following property in span rule

white-space: nowrap; 
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.