IamNOOB
IamNOOB

Reputation: 121

How to break a line after some certain width in css

I am designing a chat ui.

In my chat bubble when i enter a lot of characters it goes outside the bubble.

Are there any css techniques to break a line after certain width ?

Upvotes: 3

Views: 7117

Answers (2)

Rahul
Rahul

Reputation: 4364

p{
  width: 100px;
  border: 1px solid #111;
  word-break: break-word;
}
<p>some random text jfkdfjkd jkfdkf</p>

Upvotes: 1

Sherly Febrianti
Sherly Febrianti

Reputation: 1147

Try this :

.your-bubble {
    width: 250px; // width can be depend on you
    white-space: normal;
    word-break: break-word;
}

May this will help your problem

Upvotes: 6

Related Questions