简体   繁体   English

如何在角材料的md卡主图像上方添加更多图像

[英]How to add more images above md-card main image in angular material

I want to add another 3 images above the main image of md-card in angular material.I search trough internet and i didn't find suitable answer for that. 我想在md-card的主图像上方的角材料中添加另外3张图像。我通过互联网搜索,但没有找到合适的答案。 I have attached an image to show what i really want. 我已附上一张图片,以显示我真正想要的。 在此处输入图片说明

Any help highly appreciate. 任何帮助,高度赞赏。 Thanks, 谢谢,

You can use the flex box features provided by Angular Material to achieve the layout you want. 您可以使用Angular Material提供的伸缩框功能来实现所需的布局。

Docs - https://material.angularjs.org/latest/layout/introduction 文件-https: //material.angularjs.org/latest/layout/introduction

For example, the following will achieve what you are looking for with divs, it should be straight forward to add to a card. 例如,以下内容将实现您与div一起寻找的内容,将其直接添加到卡中应该很简单。 I recommend moving the styling to a CSS file 我建议将样式移到CSS文件

<div layout="row" style="padding: 10px; background-color:green">
    <div flex style="height:300px; width: 250px;"></div>
    <div layout="column" style="width: 100px; ">
      <div style="height: 100px; margin: 5px 0px 5px 0px; background-color: white">1</div>
      <div style="height: 100px; margin: 5px 0px 5px 0px; background-color: white">2</div>
      <div style="height: 100px; margin: 5px 0px 5px 0px; background-color: white">3</div>
    </div>
</div>

https://plnkr.co/MCj2bRj6C9PAGbOH9erL https://plnkr.co/MCj2bRj6C9PAGbOH9erL

This is how I would do it - CodePen . 这就是我要这样做的方式-CodePen Using md-whiteframe for the card effect. 使用md-whiteframe产生卡效果。

在此处输入图片说明

Markup 标记

<div ng-controller="AppCtrl" ng-cloak="" ng-app="MyApp" layout-fill layout="column" style="background:lightgrey; padding:100px">
  <div layout="row" flex="50" layout-align="center">
    <md-whiteframe class="md-whiteframe-1dp" flex="50" style="background:white" layout="column">
      <div style="background:darkgreen" flex="80" layout="row" layout-align="end">
        <div flex="20" layout-margin layout="column">
          <div style="background:red" flex>
          </div>
          <div style="background:yellow" flex>
          </div>
          <div style="background:blue" flex>
          </div>
        </div>
      </div>
      <div layout="row" layout-align="center center" flex>
        <label style="font-size:30px">Products</label>
      </div>
    </md-whiteframe>
  </div>
</div>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM