css - 如何在 Angular Material 中自定义卡片

标签 css angularjs angular-material

我将 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/

相关文章:

css - Joomla 中的单个页面与其他页面具有不同的站点 Logo

javascript - 如何将ngRepeat内容复制到另一个div中?

angular-material - 角 Material 不起作用

css - align-self 不在容器的末端,它有可用的空间来这样做

css - iframe 上的跨浏览器绝对定位 div?

html - 在单个 div 中使用两个重复的背景图像

ngFor中的Angular Material扩展面板API,如何自动关闭

javascript - 如何根据事件显示此选项卡内容

java - angularjs spring Rest文件上传表单

asp.net - 如何将 Angular Material 添加到 asp.net Angular 模板