ePezhman ePezhman - 4 years ago 176
CSS Question

how to break long word in Span?(using Twitter Bootstrap)

I'm using Twitter bootstrap in my site and I'm having span which may contain long word and I need to break it. I use this Css but not working? what's problem?

.fidDivComment {
white-space: pre-wrap;
display: inline-block;

enter image description here

Answer Source

You need to add this to your CSS for that span

span {
  -ms-word-break: break-all;
  word-break: break-all;

  /* Non standard for webkit */
  word-break: break-word;

  -webkit-hyphens: auto;
  -moz-hyphens: auto;
  hyphens: auto;

See this article for an explanation.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download