Answers for "html break text if too long"

1

html if text too long newline

word-wrap: break-word
or 
overflow-wrap: break-word; 

which works in every modern browser. IE, being a dead browser, will forever rely on the deprecated and non-standard word-wrap instead.
Posted by: Guest on January-23-2021
0

css force string to wrap

<!-- 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>

<!-- Another thing to try: -->
<tr style="overflow-wrap: anywhere"><td>1</td><td>2</td></tr>
Posted by: Guest on November-05-2020

Browse Popular Code Answers by Language