Why css not working on ion-header, ion-toolbar and ion-icon?

无人久伴 提交于 2020-07-22 05:51:09

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!