Home > Enterprise >  How to wrap text in css?
How to wrap text in css?

Time:04-06

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

CodePudding user response:

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

CodePudding user response:

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

  • Related