3

While i was making a website i had a problem of text overflow.

This is the code

div {
  width: 100px;
  background: blue;
}
 <div>sssssssssssssssssssssssssssssssssssssssss</div>

The ssssss is overflowing in the div i want them on the next line without typing <br>.

I dont know how to apply display: flex;. Please give me some code for making the sss only stand inside the div

2 Answers 2

5

Use word-break: break-all;

div {
  width: 100px;
  background: blue;
  word-break: break-all;
}
<div>sssssssssssssssssssssssssssssssssssssssss</div>

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

1 Comment

@Advaith, I'm glad it helped! Happy Coding
3

Use word-break: break-all property

div {
      width: 100px;
      background: blue;
      word-break: break-all
  
    }

Check this jsfiddle

1 Comment

Thank you very much bro.

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.