how to wrap text css code example

Example 1: make text not wrap css

white-space: nowrap;

Example 2: how to wrap text in div css

.example {
  overflow-wrap: break-word;
}

Example 3: css p tag text wrap

p { 
  /*  That create a ne line, when he word is to long*/
  word-break: break-all 
}

Example 4: css break wrap header

h1{
	word-break: break-word;
}

Example 5: 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>

Tags:

Html Example