如何防止项目文本换行

时间:2017-02-23 00:31:19

标签: html css angularjs angular ionic-framework

这是我的代码:

<ion-list>
  <ion-item>
    <ion-avatar item-left>
      <img src="img/avatar-small.jpg">
    </ion-avatar>
    <h2>Alissa Connor said something</h2>
    <p>Sed ut perspiciatis unde omnis iste natus error sit Sed ut perspiciatis unde omnis iste natus error sit Sed ut perspiciatis unde omnis iste natus error sit </p>
  </ion-item>
</ion-list>

And what I get

And what I get

我可能使用错误的元素来做这件事,但我希望看到整篇文章。

有什么想法吗?

2 个答案:

答案 0 :(得分:3)

Ionic有预定义的风格。在您的离子项(或Ionic 1中的public class Rules { public static final JarvisFilterRule FILTER = new JarvisFilterRule(); public static class JarvisFilterRule extends RelOptRule { private JarvisFilterRule() { super(operand(Filter.class, operand(Query.class, none()))); } public void onMatch(RelOptRuleCall call) { // do something } } } 类)上使用text-wrap

item-text-wrap

答案 1 :(得分:1)

just provide some idea for this issue. i didn't test this.

.word-wrap {
  overflow-wrap: break-word;
  word-wrap: break-word;
  -ms-word-break: break-all;
  word-break: break-word;
  -ms-hyphens: auto;
  -moz-hyphens: auto;
  -webkit-hyphens: auto;
  hyphens: auto;
}

<p class="word-wrap">Sed ut perspicia.....</p>