我有一些像这样的网格块:
<mat-grid-list cols="2" rowHeight="200px">
<mat-grid-tile [colspan]="1" [rowspan]="1">
<h3>Some Title</h3>
<p>Some text</p>
</mat-grid-tile>
...
</mat-grid-list>
我希望文本显示如下:
Some Title
Some text
但它始终显示为
Some TitleSome text
我尝试使用<br/>
以及white-space:pre; content:"\a"; white-space:pre-wrap
之类的css以及其他一些我要介绍的东西。
我真是个白痴,没有得到这个。
这是一堆显示问题的闪电战 https://angular-f9ficf.stackblitz.io
答案 0 :(得分:0)
没关系,我知道了。它需要包装在div标签中。
<mat-grid-list cols="2" rowHeight="200px">
<mat-grid-tile [colspan]="1" [rowspan]="1">
<div>
<h3>Some Title</h3>
<p>Some text</p>
</div>
</mat-grid-tile>
...
</mat-grid-list>