Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Overflow prob in css

Tags:

html

css

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

like image 206
Advaith Avatar asked Jul 01 '26 09:07

Advaith


1 Answers

Use word-break: break-all;

div {
  width: 100px;
  background: blue;
  word-break: break-all;
}
<div>sssssssssssssssssssssssssssssssssssssssss</div>
like image 160
Rayon Avatar answered Jul 04 '26 00:07

Rayon



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!