georgian
georgian

Reputation: 1

CSS - if text contains no spaces it makes horizontal scroll inside tab div

My css rule for the div:

.message-body {
    background: #5181a2;
    padding: 8px 5px;
    text-align: justify;
}

I want to render this text inside the div like 'hello hello' is in previous line.

Upvotes: 0

Views: 49

Answers (1)

Awais
Awais

Reputation: 4912

Use word-break property:

.message-body {
    background: #5181a2;
    padding: 8px 5px;
    text-align: justify;
    word-break: break-all;
}

Upvotes: 2

Related Questions