Skip to main content

If you have upgraded Ionic to 5 or 6 you will have experienced that the padding attribute is not working anymore.

<ion-content padding *ngIf="loaded" color="medium">

Use of attributes was deprecated in Ionic v4.  If you would have noticed in developers console, Ionic 4 was presenting warnings of using these attributes.  So post Ionic 4, these attributes were transitioned to CSS classes.

Now use these 'classes' as follows

<ion-content class="ion-padding" *ngIf="loaded" color="medium">

 

Related articles

Andrew Fletcher29 Sep 2023
Setting up an ionic app
Recently a client handed me code that runs an app through iOS and Android. &nbsp;No details about whether native or otherwise. &nbsp;Once I had the opportunity to crawl through the code, definitely not native. &nbsp;Typescript, Angular, Cordova... etc.Glancing at the modification dates, the last...
Andrew Fletcher08 Aug 2022
How to update package.json dependencies to the latest version?
This article works through the steps to update&nbsp;dependencies in package.json file to the latest version. Use npm-check-updates or npm outdated to suggest the latest versions. npm-check-updates is a utility that automatically adjusts a package.json with the latest version of all...