问题
I'm create Ionic 4 angular app, and used css styles on ion-header, ion-toolbar and ion-icon. but css not work as expected ?
Here is my stackblitz code
回答1:
ts file
you have not include styleUrls, thus styles are not being applied
please add:
styleUrls: ['/home.css']
your config will look like:
@Component({
selector: 'page-home',
templateUrl: 'home.html',
styleUrls: ['home.css']
})
回答2:
Use style url properly as styleUrls: ['/home.css'], Your are overriding the build in functionality of ionic and no link of that style file in template
来源:https://stackoverflow.com/questions/56574419/why-css-not-working-on-ion-header-ion-toolbar-and-ion-icon