如何设置背景色IONIC 4 [英] How to set background color IONIC 4
问题描述
我在尝试仅在一个IONIC 4(--type = angular)页面上更改背景颜色时遇到问题.我正在尝试为离子含量添加一个类.在我的html文件中,我有:
I having problems trying to change the background color in just one IONIC 4 (--type=angular) page. I am trying to add a class for the ion-content. In my html file I Have:
<ion-content class="fondologin">
...
</ion-content>
在我的屁股上,我有:
.fondologin{
background-color: #111D12!important;
}
背景颜色从不改变.如果我添加--ion-background-color:#111D12;在variables.scss中,成功地为每一页更改了背景,但是我只更改了一页的颜色.我该如何实现?
The background color is never changed. If I add --ion-background-color:#111D12; in variables.scss the background is successfully changed for every page but I just one to change the color in one page. How can I achieve this?
推荐答案
出于某种原因,我以这种方式解决了该问题:
For some reason I solved it this way:
首先,我在主题文件夹内的variables.scss
文件中添加了--ion-background-color:#ffffff;
.
First of all I added --ion-background-color:#ffffff;
in the variables.scss
file inside theme folder.
在我的Page scss中,我写道:
In my Page scss I wrote:
ion-content{
--ion-background-color:#111D12;
}
之后成功设置背景.
这篇关于如何设置背景色IONIC 4的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!