11

我在我的网站中使用 Twitter 引导程序,并且我的跨度可能包含长词,我需要打破它。我使用这个 Css 但不工作?什么问题?

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

在此处输入图像描述

4

2 回答 2

31

您需要将其添加到该跨度的 CSS

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;
}

请参阅这篇文章以获得解释。

于 2013-06-15T15:16:21.717 回答
4

这些问题说明了这一点:

(使用推特引导)

所以引导修复是这样的:@include hyphens; 这个开箱即用的引导混合将添加 word-wrap: break-word; 这个混合存在于这个路径下:

/bootstrap-sass/assets/stylesheets/bootstrap/mixins/_vendor-prefixes.scss
于 2016-08-01T07:47:51.770 回答