Michael Rosello
Michael Rosello

Reputation: 153

label adjust content when reach max width

What property do I set to my label when I want to continue to next line when It reached my max width.

I tried using

overflow:hidden;

but what I want is the text will continue in the next line, not clipped.

Here are the properties that I'm using on my label and div.

.lblComment {
    width:100%;
    font-size:10px;
    min-height:20px;
}

.divComment {
    width:880;
    max-width:880;
    border-style:solid;
    border-width:thin;
    border-color:red;
}

Upvotes: 1

Views: 945

Answers (1)

Mathew Thompson
Mathew Thompson

Reputation: 56429

As the text doesn't have any spaces, you need to force wrapping to break the word on .lblComment:

word-wrap: break-word;

DEMO

Upvotes: 1

Related Questions