Here is a code snippet that I'm having trouble with:
<span readonly="true" id="textarea" cols="60" rows="1">
<pre style="{display:inline; white-space: pre-wrap; word-wrap:break-word;}"> SOME TEXT HERE </pre>
</span>
I am facing two main issues. Firstly, when I input a very long string without spaces or newlines, like in this example:
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.
In Firefox and Opera, the text displays normally as:
aaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaa
However, in Chrome, IE, and Safari it appears as:
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
exceeding the screen width.
The second issue is that in Chrome, IE, and Safari, instead of displaying inline as intended, it shows as block even though I specified "display: inline;"
SOLVED: By using <span> instead of <pre>, it was inline from the start. Additionally, removing the curly braces {} fixed the display issue on Chrome, IE, and Safari. Thank you for your help!