html wrap content code example

Example 1: how to wrap text in div css

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

Example 2: css p tag text wrap

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

Example 3: flex wrap css

<style> 
#datadiv {
  width: 200px;
  height: 200px;
  border: 1px solid #c3c3c3;
  display: flex;
  flex-wrap: wrap;
}

#datadiv div {
  width: 50px;
  height: 50px;
}
</style>
</head>
<body>

<h1>The flex-wrap Property</h1>

<div id="datadiv">
  <div style="background-color:red;">A</div>
  <div style="background-color:green;">B</div>
  <div style="background-color:yellow;">C</div>
  <div style="background-color:blue;">D</div>
  <div style="background-color:cyan;">E</div>
  <div style="background-color:indigo;">F</div>
</div>

Example 4: felx-wrap css

The flex-wrap property specifies whether the flexible items should wrap or not. Note: If the elements are not flexible items, the flex-wrap property has no effect.

Tags:

Css Example