0

Is there a way to prevent text from overflowing its div container without using white-space:normal?

Vivek Kumar
  • 4,822
  • 8
  • 51
  • 85
Jymbo
  • 296
  • 5
  • 18

2 Answers2

2

Use the overflow css property. It has four properties you can choose from, hidden, auto, scroll and visibile.

.overflow-text{
  //option 1
  overflow: hidden;
  //option 2
  overflow: auto;
  //option 3
  overflow: scroll;
  //option 4
  overflow: visible;
 }
Daniel Gonzalez
  • 162
  • 1
  • 2
  • 13
1
overflow-wrap: break-word;
-ms-word-wrap: break-word;
word-wrap: break-word;
-ms-hyphens: auto;
Vivek Kumar
  • 4,822
  • 8
  • 51
  • 85