I have a card and I’ve inserted a grid in it with a column but I am not being able to center it so that no matter what size the display is, the address will be shown in the middle.
<ion-grid>
...
<ion-row>
<ion-col>
<button ion-button clear small>
<div text-center>This text should be centered in the row but it's not</div>
</button>
</ion-col>
</ion-row>
...
I’ve tried col-6 and offset-6 but this justifies it only on a specific display,as soon as I increase the width of the screen on the browser,the text moves away from the center.
You only have one column with no explicit width, so it’s going to take up the full width. If you just want to center the contents try applying text-center to col. Not sure what the effect of cramming long text into a small button is, that’s probably why things aren’t looking right.
<ion-grid>
...
<ion-row>
<ion-col text-center>
<button ion-button clear small>
<div text-center>This text should be centered in the row but it's not</div>
</button>
</ion-col>
</ion-row>
...
Or if you want to use the offset, then you only want to offset by 3, not 6. That way you have 3 units on each side, and a col with a width of 6 units in the middle.