Md卡填充

时间:2015-06-29 07:07:37

标签: html css angularjs angular-material

您好我使用的是角质材料。我用以下代码创建了一张md-card:

<div  layout="row">
<md-card class="col-md-4">
  <div class="md-card-image" style="background-color: #40DEC8; text-align: center">
    <h1 style="color: white;">Title</h1>
  </div>
  <md-input-container>
    <label>Name</label>
    <input ng-model="detailsCtrl.parking.name">
  </md-input-container>
  <md-input-container>
    <label>District</label>
    <input ng-model="detailsCtrl.parking.district">
  </md-input-container>
  <md-input-container>
    <label>Description</label>
    <textarea ng-model="detailsCtrl.parking.description" columns="1" md-maxlength="500"></textarea>
  </md-input-container>
</md-card>

结果如下: enter image description here

有没有办法删除黑色箭头所示的空白区域(填充)并用绿色填充?

1 个答案:

答案 0 :(得分:1)

不是添加填充的卡,而是(我假设引导程序)类col-md-4。解决方案是将col-md-4移到md-card之外,如下所示:

<!-- The padding will be on this div instead of the card -->
<div class="col-md-4"> 
    <md-card>
        <div class="md-card-image" style="background-color: #40DEC8; text-align: center">
            <h1 style="color: white;">Title</h1>
        </div>
        <!-- Other html -->
    </md-card>
</div>