# Change toolbar-background

**URL:** <https://forum.ionicframework.com/t/change-toolbar-background/227328>\
**Category:** Ionic Framework\
**Created:** [September 29, 2022, 10:28am UTC](https://forum.ionicframework.com/t/change-toolbar-background/227328 "2022-09-29T10:28:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lsantaniello](https://avatars.discourse-cdn.com/v4/letter/l/e495f1/32.png) [@lsantaniello](https://forum.ionicframework.com/u/lsantaniello)\
**Post date:** [September 29, 2022, 10:28am UTC](https://forum.ionicframework.com/t/change-toolbar-background/227328/1 "2022-09-29T10:28:00Z")

</div>

I migrated on Capacitor but I have issue on my header. I can’t change background color.

If I use inspector and add style at runtime, it works.

This is the android screen

 ![image](https://global.discourse-cdn.com/ionicframework/original/3X/6/3/63849a805926ca9cf17da35b26bd49da50e8edf3.jpeg)

This is the fix with inspector

 ![image](https://global.discourse-cdn.com/ionicframework/original/3X/5/c/5c672df087180e5f23e2d1a9ce9ed51b915ecccd.png)

HTML:

```auto
<ion-header class="ion-no-border">
    <ion-toolbar class="ion-padding-top mgd-toolbar">
        <ion-item lines="none">
            <ion-avatar slot="start" *ngIf="icon">
                <img [src]="icon" alt="" />
            </ion-avatar>
            <ion-label>
                <h2>{{ title }}</h2>
                <p>{{ description }}</p>
            </ion-label>
        </ion-item>
        <ion-buttons slot="start" *ngIf="canGoBack">
            <ion-button (click)="back()">
                <ion-icon slot="icon-only" name="chevron-back"></ion-icon>
            </ion-button>
        </ion-buttons>
        <ion-buttons slot="end">
            <ion-menu-button></ion-menu-button>
        </ion-buttons>
    </ion-toolbar>
</ion-header>

```

SCSS:

```auto
.mgd-toolbar {
    background-color: red !important;
    background: green !important;
}

.toolbar-container {
    background-color: yellow !important;
    background: brown !important;
}

```

Thanks in advance

---

<div class="post-metadata">

**Author:** ![EinfachHans](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/einfachhans/32/130917_2.png) [@EinfachHans](https://forum.ionicframework.com/u/EinfachHans)\
**Post date:** [September 29, 2022, 11:45am UTC](https://forum.ionicframework.com/t/change-toolbar-background/227328/2 "2022-09-29T11:45:18Z")

</div>

Use the css Variable `--background`, this is documented [here](https://ionicframework.com/docs/api/toolbar#css-custom-properties)
