Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a footer on ion-card

Tags:

ionic2

ionic3

How to craete footer on ion-card. Tried these example as below but not working.please help

.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>
like image 353
prasana Avatar asked Dec 26 '17 07:12

prasana


People also ask

How to add footer in Ionic elements?

The main class for Ionic footers is bar (the same as header). When you want to add footer to your screens, you need to add bar-footer class to your element after the main bar class.

What is an ion-card?

Cards are a standard piece of UI that serves as an entry point to more detailed information. A card can be a single component, but is often made up of some header, title, subtitle, and content. ion-card is broken up into several sub-components to reflect this.

How to add card header in card?

Card header is created with ion-card-header UI component and It is needed to declare to insert the Header in card. Here is simple example of card headers. Define the HTML img tag inside the ion-card tag to show the image in the card. Add the ion-footer inside the ion-card, It shows the extra meta information in the bottom of the card.

What are the advantages of a card in ionic framework?

A card shows data in a more organized manner. Cards are handy and better from the user experience perspective to display more information on a small screen at once. One of the best things which i like most about Ionic is that it offers tons of UI components to create a beautiful layout for a hybrid mobile application.


2 Answers

You need to use ion-col and ion-row in ion-card.It works.

<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>
like image 105
Aneri Vala Avatar answered Oct 20 '22 07:10

Aneri Vala


Using and completing the other answer: https://stackoverflow.com/a/47975359/4280561

Here goes the all code:

the 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>

and the CSS :

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

.has-card-footer {
  padding-bottom: 15px;
}
like image 39
oiawo Avatar answered Oct 20 '22 06:10

oiawo