Does anyone know how to add a line break '\n' to a string in an HTML element if the width exceeds 120 pixels? For example, given this piece of code:
<div id='foo' style='background:transparent;color:white;width:120px'><p>test_text_test_text_test_text_test_text_test_text_test_text_test_text</p></div>
I would like it to look something like this:
<div id='foo' style='background:transparent;color:white;width:120px'><p>test_text_test_text\n_test_text_test_text\n_test_text_test_text\n_test_text</p></div>
Your help will be greatly appreciated. Thank you!