为什么CSS在离子头,离子工具栏和离子图标上不起作用? [英] Why css not working on ion-header, ion-toolbar and ion-icon?

查看:81
本文介绍了为什么CSS在离子头,离子工具栏和离子图标上不起作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了Ionic 4 angular应用程序,并在离子头,离子工具栏和离子图标上使用了CSS样式.但是CSS无法正常工作吗?

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 ?

这是我的stackblitz代码

推荐答案

ts文件

您尚未包含styleUrls,因此样式不会被应用

you have not include styleUrls, thus styles are not being applied

请添加:

styleUrls: ['/home.css']

您的配置如下所示:

@Component({
  selector: 'page-home',
  templateUrl: 'home.html',
  styleUrls: ['home.css']
})

这篇关于为什么CSS在离子头,离子工具栏和离子图标上不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆