How to use text-wrap css property

So I used overflow-wrap and word-wrap to wrap my text in a div. But in smaller devices words are getting broken down. So I found out about text-wrap, but I don't know how to use it. I tried it out like this.
text-wrap: balance;
text-wrap: balance;
But it is showing Unknown property: 'text-wrap'. What am I doing wrong? Here is the link to the docs - https://developer.chrome.com/blog/css-text-wrap-balance/
Chrome Developers
CSS text-wrap: balance - Chrome Developers
A classic typography technique of hand-authoring line breaks for balanced text blocks, comes to CSS.
2 Replies
Kevin Powell
Kevin Powell2y ago
text-wrap: balance is very new, so VS Code might still flag it as unknown, and it's only supported in Chrome at the moment. It also only works on 3 lines of text or less. It also is about balancing text out, instead of leaving one word alone on a line.
This is a longer heading with a lot of
words
This is a longer heading with a lot of
words
you would get this:
This is a longer heading
with a lot of words
This is a longer heading
with a lot of words
Is there a reason you need to do anything? text should already wrap on it's own without you doing anything.
AnasYasien
AnasYasien2y ago
hello Mr. Kevin I would love to thank you so much about your effort and tutorials, I'd like to ask you as you are professional on what you doing i want to learn html, css, javascript from the very scratch can you lead me to any great tutorials ?? something else if that's okay with you it would be my honour to become of your friends
Want results from more Discord servers?
Add your server