I'm building a little sticky notes app for fun, and sometimes this happens:

(It's because the first word is wider than the width of the note.)
Is there a way to check whether the scrollbar is present with Javascript? If I can do that, I can resize the note until it contains the text without the scrollbar.
This CSS3 property will break a word within if it is too large for its container:
#selector {
word-wrap: break-word;
}
word-wrap: normal; to toggle style
This works in basically every browser and believe it or not, support for the property goes as far back as IE5. Credit for this goes to Louis Lazaris for his post, Word-Wrap: A CSS3 Property That Works in Every Browser.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With