Home >Web Front-end >CSS Tutorial >How to Wrap Long Unbroken Strings in HTML Textareas?
Wrapping Unbroken Strings
Question:
How can you ensure that a long string without any whitespace characters, like a DNA sequence, wraps correctly within an HTML textarea or XUL textbox?
Answer:
For block elements, like textarea and textbox, you can utilize the word-wrap CSS property to control how the text wraps. By setting it to break-word, it breaks the string at appropriate character boundaries, wrapping the text as needed.
Example Code:
<textarea>
This CSS style will wrap the long DNA sequence at the appropriate character boundaries, ensuring readability within the specified width of the textarea.
The above is the detailed content of How to Wrap Long Unbroken Strings in HTML Textareas?. For more information, please follow other related articles on the PHP Chinese website!