angular - Angular 项目中的 CSS
问题描述
我有一个以文件命名about
的文件夹,about.component.css
我希望背景颜色aqua
仅用于页面about.component.html
。
如果我在文件中about.component.css
这样做:
body {
background-color: aqua;
}
什么都没有显示... CSS 中的这个文件在这个路径上:
C:\dev\demo\src\app\home\home.component.css
我认为我必须在home.component.css
某处调用文件?
谢谢
解决方案
:host {
background-color: aqua;
}
推荐阅读
- c - 删除单链表中的两个相邻节点
- ruby-on-rails - Rails 记录其中至少一个与属性值的关联
- scala - Scala shell 无法识别火花
- python - 通过 CloudML 获取 TFrecords 的批量预测
- python - numpy.dtype=object 与 numpy.dtype=int 相比非常慢
- swift - 图表上的动态数据(图表窗格)
- android - Android Studio Kotlin 代码建议 IDE 致命错误
- java - 移动椭圆和矩形(多部分)的碰撞检测问题
- excel - 需要 VBA 帮助的剪切和粘贴循环
- android - notifyitemchanged(position) 第一次刷新列表中的项目,之后不再刷新