Enjoy with CSS!(word-wrap)

Sometimes there will be scenario when a particular word that you want to show is larger than the screen size.In that case if we resize the screen size we would want the remaining text to be shown on the new line.In that case flex-wrap property will not work. So in that case we need to use word-wrap that wraps the remaining text on to a new line. So in these cases just add the CSS code { word-wrap:break-word; hyphens:auto; } Here hyphens property will put a hyphen at the end of the line so as to give idea that the remaining word is on the new line.

Jan 22, 2025 - 14:53
 0
Enjoy with CSS!(word-wrap)

Sometimes there will be scenario when a particular word that you want to show is larger than the screen size.In that case if we resize the screen size we would want the remaining text to be shown on the new line.In that case flex-wrap property will not work.
So in that case we need to use word-wrap that wraps the remaining text on to a new line.
So in these cases just add the CSS code
{
word-wrap:break-word;
hyphens:auto;
}

Here hyphens property will put a hyphen at the end of the line so as to give idea that the remaining word is on the new line.

What's Your Reaction?

like

dislike

love

funny

angry

sad

wow