'How to wrap text in css?

the text just overflows into a vertical direction.How to make it wrap? css for the div:

.taskdescription{
  display:block;
  word-wrap: break-word;
  overflow: auto;
  color: #673ab7;
  width: 300px;

} 

what its looking like.

enter image description here



Solution 1:[1]

Ok so I used white-space: no wrap which was overriding this properties.So changing it to white-space:normal solved my problem.Thank you

Solution 2:[2]

The overflow-wrap has attributes: normal, break-word, anywhere. When you change with word-wrap it will work.

The easy-squeeze example is on w3school-overflow-wrap You mismatched the overflow ( this is for scroll ) with word-wrap or overflow-wrap.

The first one is for text and the second is for long-word. This is a confused bunch of CSS properties because overflow is doing something else. Try to decode it in the w3school example - works the same as a fiddle.

word-wrap - example overflow - example scrolling-bar

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Debaditya Sinha
Solution 2 Piotr Adamkowski