【问题标题】:Angular material card menu at the top right右上角的角材质卡菜单
【发布时间】:2020-11-06 14:42:02
【问题描述】:

如何在卡片右上角添加菜单,使用角度材料,根据https://material.angular.io/components/card/overview文档,没有标签。

我想在右上角添加一个按钮,如图所示

    <mat-card class="custome-card">
    <a [routerLink]="['/products/123']">
        <img mat-card-image
            src="https://wonderfulengineering.com/wp-content/uploads/2013/12/Lamborghini-wallpaper-14.jpg"
            alt="Photo of a Shiba Inu">
    </a>
    <mat-card-content>
        <a [routerLink]="['/products/123']" class="productDetail"><span
                class="mat-subheading-2">Lamborghini Aventador</span></a><br>
        <span>NRs 1 - 2 Crore</span><br>
        <strong>Size: </strong> <span>XL L M S XS</span>
    </mat-card-content>
    <mat-card-actions>
        <div fxLayout="row" fxLayoutAlign="center">
            <falcon-button [field]="favoriteBtnConfig"></falcon-button>&nbsp;
            <falcon-button [field]="shareBtnConfig"></falcon-button>&nbsp;
            <falcon-button [field]="shopCartBtnConfig"></falcon-button>
        </div>
    </mat-card-actions>
</mat-card>

以上代码创建如下图片

【问题讨论】:

    标签: html css angular angular-material angular10


    【解决方案1】:

    这解决了问题

     .mdl-card__menu {
            position: absolute;
            right: 16px;
            top: 16px;
        }
    

    【讨论】:

      猜你喜欢
      • 2019-03-04
      • 2017-08-05
      • 2018-05-08
      • 2016-05-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多