如何在离子卡上创建页脚

pra*_*ana 7 ionic2 ionic3

如何在离子卡上使用页脚.试过这些例子如下,但没有工作.请帮忙

.HTML

<ion-card class="dashboardgraph">
    <ion-card-header class="cardheader">
      CNC 10
     </ion-card-header> 
    <ion-footer class="cardfooter">
      footer here ///    
     </ion-footer>
</ion-card>
Run Code Online (Sandbox Code Playgroud)

小智 14

你需要在离子卡中使用ion-col和ion-row.它有效.

<ion-content fullscreen>
  <ion-card>
   <ion-card-header class="cardheader">
      CNC 10
    </ion-card-header> 

    <ion-card-content>
     Content of the card
    </ion-card-content>

    <ion-row class="cardfooter">
      <ion-col>
            <p>Footer goes here </p>
      </ion-col>
    </ion-row>
  </ion-card>
</ion-content>
Run Code Online (Sandbox Code Playgroud)

  • 适用于Ionic 4。 (4认同)

小智 5

使用并完成其他答案:/sf/answers/3358275161/

这是所有代码:

HTML:

  <ion-card class="has-card-footer">
      <ion-card-header>
          CNC 10
      </ion-card-header> 

      <ion-row class="card-footer">
          <ion-col>
              <p>Footer goes here </p>
          </ion-col>
      </ion-row>
  </ion-card>
Run Code Online (Sandbox Code Playgroud)

和CSS:

.card-footer {
  position: absolute;
  bottom: 0;
  width: 100%;
}

.has-card-footer {
  padding-bottom: 15px;
}
Run Code Online (Sandbox Code Playgroud)