I’ve been unable to set a background image in Ionic 4. I’ve tried
ion-content {
--background: #fff url("../../../assets/img/login-image.jpg") no-repeat center center / cover;
}
and
ion-content {
background-image: url("…/…/…/assets/img/login-image.jpg");
-webkit-background-image: url("…/…/…/assets/img/login-image.jpg");
background-repeat: no-repeat;
background-size: cover;
}
I’m certain the relative paths are correct because if I change them I get a compile error.
page-details {
ion-content {
--background: #fff url("../../../assets/img/login-image.jpg") no-repeat center center / cover;
// background-image: url("../../../assets/img/login-image.jpg");
// -webkit-background-image: url("../../../assets/img/login-image.jpg");
// background-repeat: no-repeat;
// background-size: cover;
}
form {
margin-bottom: 32px;
button {
margin-top: 20px !important;
}
}
p {
font-size: 0.8em;
color: #d2d2d2;
}
ion-label {
margin-left: 5px;
}
ion-input {
padding: 5px;
}
.invalid {
border-bottom: 1px solid #ff6153;
}
.error-message {
min-height: 2.2rem;
ion-label {
margin: 2px 0;
}
}
}
`type or paste code here`