How to make the long text to fit inside a small div?

All you need is word-wrap: break-word;

.limit{
    width:50px;
    word-wrap: break-word;
}
<div class="limit">
    <p>fasfhfhsjdhkjhdkjhfjkhdsfjkhdfjhdfiuhadfhjdfhjadskf kjahsdjfahdfuahsdf dhsf</p>
</div>

Demo

On the other hand, if you are not looking to break the sentence, you can also use overflow property set to auto or overflow-x: scroll;Demo

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)