0

I am using <code> tag to wrap inline code and breaking the long words using the overflow-wrap: break-word; property. It is only working in Chrome and Firefox, but not in IE 11. So far I have tried word-wrap, word-break, and even -ms-word-break. Here is the fiddle.

Does anyone know how to break lines in IE 11?

Cody
  • 2,480
  • 5
  • 31
  • 62
  • look at this maybe https://stackoverflow.com/questions/20149715/internet-explorer-11-word-wrap-is-not-working – Ylama Jan 11 '18 at 08:36
  • I have tried `white-space: pre-wrap` this property too. Still not working – Cody Jan 11 '18 at 08:39

1 Answers1

0

Your text will wrap if it's needed, so you have to set a width of your container to force it to wrap like that :

<!DOCTYPE html>
<html>
<head>
 <style>
 code {
  background-color: #f7f7f7;
  /* padding: 0px 2px; */
  color: rgb(232, 76, 128);
  /*word-wrap: break-word; */
  /*-ms-word-break: break-word;*/
  word-break: break-all; 
  overflow-wrap: break-word;   
 }
  p{
    width:25%;
  }
</style>
</head>
<body>
 <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod <CODE>a.long.keyword.which.i.want.to.break</CODE>
  tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
  quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
  consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
  cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
 proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</body>
</html>

Is it what you want to do ?

  • Oh, i usually don't bother myself trying to support IE because a lot of things doesn't work on it , and very few people use it , I don't think it's worth it. But if you want to support it anyway I can't help you i'm sorry :( –  Jan 12 '18 at 20:40