htmlcssstringxulword-wrap

How can I force a long string without any blank to be wrapped?


I have a long string (a DNA sequence). It does not contain any whitespace character.

For example:

ACTGATCGAGCTGAAGCGCAGTGCGATGCTTCGATGATGCTGACGATGCTACGATGCGAGCATCTACGATCAGTCGATGTAGCTAGTAGCATGTAGTGA

What would be the CSS selector to force this text to be wrapped in a html:textarea or in a xul:textbox?


Solution

  • for block elements:

    <textarea style="width:100px; word-wrap:break-word;">
      ACTGATCGAGCTGAAGCGCAGTGCGATGCTTCGATGATGCTGACGATGCTACGATGCGAGCATCTACGATCAGTC
    </textarea>

    for inline elements:

    <span style="width:100px; word-wrap:break-word; display:inline-block;"> 
       ACTGATCGAGCTGAAGCGCAGTGCGATGCTTCGATGATGCTGACGATGCTACGATGCGAGCATCTACGATCAGTC
    </span>