Align a button within ion-item using text-center attribute doesn't work after I modify the button with CSS. The following code work fine. The buttons were centrally aligned.
<ion-list>
<ion-item text-center><button ion-button (click)="gotoPage1();">Go page 1</button></ion-item>
<ion-item text-center><button ion-button (click)="gotoPage2()">Go page 2</button></ion-item>
<ion-item text-center><button ion-button (click)="gotoPage3()">Go page 3</button></ion-item>
</ion-list>
But after I use CSS to modify the button. The buttons were no longer centrally aligned. Here is the code :
<ion-list>
<ion-item text-center><button ion-button class="homeBtn" (click)="gotoPage1();">Go page 1</button></ion-item>
<ion-item text-center><button ion-button class="homeBtn" (click)="gotoPage2()">Go page 2</button></ion-item>
<ion-item text-center><button ion-button class="homeBtn" (click)="gotoPage3()">Go page 3</button></ion-item>
</ion-list>
CSS code :
homeBtn { display:block; height: 50px;
width: 300px;
/* border-radius: 50%; */
border: 1px ;
background-color: white;
color: black; }
text-align: center
with CSS? – Pablo Darde