# Unable to set background image on page

**URL:** <https://forum.ionicframework.com/t/unable-to-set-background-image-on-page/158075>\
**Category:** Ionic Framework\
**Created:** [March 3, 2019, 8:02pm UTC](https://forum.ionicframework.com/t/unable-to-set-background-image-on-page/158075 "2019-03-03T20:02:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![DMoney](https://avatars.discourse-cdn.com/v4/letter/d/b5a626/32.png) [@DMoney](https://forum.ionicframework.com/u/DMoney)\
**Post date:** [March 3, 2019, 8:02pm UTC](https://forum.ionicframework.com/t/unable-to-set-background-image-on-page/158075/1 "2019-03-03T20:02:09Z")

</div>

I’ve been unable to set a background image in Ionic 4. I’ve tried

```auto
     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.

```auto
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`

```
