How to make space between 2 divs in Ionic
P粉203792468
P粉203792468 2024-02-17 15:40:27
0
1
323

I need space at the top and bottom of the image so it will be centered and the ion-col will be down.

<ion-content [fullscreen]="true" class="bg-class" text-center>

  <ion-img src="assets/icon/moon_logo.png" style="width:80%; margin: auto;">
  </ion-img>

  <ion-col>
    <div style=" margin: auto; padding-bottom: 15px;">
      <ion-button expand="block" style="--background:white; color: #1B0B50;">Login</ion-button>
    </div>
    <div style="margin: auto;">
      <ion-button expand="block">Get Started</ion-button>
    </div>
    <ion-row style="justify-content: center;">
      <p style="color: #576898; font-size: 12px;">Privacy Policy</p>

      <p style="color: #576898; font-size: 12px; padding-left: 20px;">Terms Of Use</p>
    </ion-row>
  </ion-col>

</ion-content>

Expected display results

P粉203792468
P粉203792468

reply all(1)
P粉883278265

First, use ion-col in ion-row and ion-row in ion-grid, otherwise you will see unexpected results. There are many solutions now, one is to use flex and flex-grow:


  
...
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template