Reputation: 51
I have got this css code
margin:100px 30px 0;
color: black;
font-size: 32px;
width: 250px;
font-family: sans-serif;
word-break: break-word;
overflow: hidden;
But when my div's text is too long it is not going into new line automatically.
Upvotes: 0
Views: 4833
Reputation: 856
Your code works i think there is an other problem did you not overwrite it some where else in your css?
div{
margin:10px 30px;
color: black;
font-size: 32px;
width: 250px;
font-family: sans-serif;
word-break: break-word; /*word-wrap: break-word;*/
overflow: hidden;
}
<div>
<p>
reomndnsvnunqjnvnbnvdfnsbnsnbnisnbninbinnbnfknbindfibnfnbinqsibninfinibnsdinisndinbisnfdiobnisnbinsi
</p>
</div>
Upvotes: 2