我将 Angular Material 用于 Web 应用程序作为一个业余元素。我查看了官方引用资料,但无法弄清楚如何自定义卡片的外观。例如,请考虑我的用例:我希望卡片图像填满整张卡片并在其上叠加一些文本。怎么做?引用中提供的代码插图目前是这样的:
<md-card>
<img src="img/washedout.png" class="md-card-image" alt="Washed Out">
<md-card-content>
<h2 class="md-title">Paracosm</h2>
<p>
The titles of Washed Out's breakthrough song and the first single from Paracosm share the
two most important words in Ernest Greene's musical language: feel it. It's a simple request, as well...
</p>
</md-card-content>
</md-card>
上面的代码将呈现为 https://material.angularjs.org/#/demo/material.components.card 所示。
我必须重写 css 还是有其他方法?
最佳答案
几天后他们将发布 Angular Material version 0.10 - 这将包括 new layouts for cards ;以前的版本需要通过 css 和自定义指令/div 来执行此操作。
关于css - 如何在 Angular Material 中自定义卡片,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29760930/