# Change toast "close" button and text css

**URL:** <https://forum.ionicframework.com/t/change-toast-close-button-and-text-css/153799>\
**Category:** ionic-v3\
**Created:** [January 22, 2019, 10:50am UTC](https://forum.ionicframework.com/t/change-toast-close-button-and-text-css/153799 "2019-01-22T10:50:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kyrax80](https://avatars.discourse-cdn.com/v4/letter/k/aca169/32.png) [@Kyrax80](https://forum.ionicframework.com/u/Kyrax80)\
**Post date:** [January 22, 2019, 10:50am UTC](https://forum.ionicframework.com/t/change-toast-close-button-and-text-css/153799/1 "2019-01-22T10:50:31Z")

</div>

Hello, how can I change the text inside a toast and the close button’s style?

Thanks!

---

<div class="post-metadata">

**Author:** ![Ludolefrenchy](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/ludolefrenchy/32/121185_2.png) [@Ludolefrenchy](https://forum.ionicframework.com/u/Ludolefrenchy)\
**Post date:** [January 22, 2019, 11:07am UTC](https://forum.ionicframework.com/t/change-toast-close-button-and-text-css/153799/2 "2019-01-22T11:07:51Z")

</div>

hello,  
you can use

```auto
cssClass:'yourcssclass'

```

in css file

```auto
.yourcssclass { }

```

---

<div class="post-metadata">

**Author:** ![Kyrax80](https://avatars.discourse-cdn.com/v4/letter/k/aca169/32.png) [@Kyrax80](https://forum.ionicframework.com/u/Kyrax80)\
**Post date:** [January 22, 2019, 11:19am UTC](https://forum.ionicframework.com/t/change-toast-close-button-and-text-css/153799/3 "2019-01-22T11:19:22Z")

</div>

I know about that, but I don’t what tag or id class to use to override the close button text or the toast’s text

---

<div class="post-metadata">

**Author:** ![Ludolefrenchy](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/ludolefrenchy/32/121185_2.png) [@Ludolefrenchy](https://forum.ionicframework.com/u/Ludolefrenchy)\
**Post date:** [January 22, 2019, 2:00pm UTC](https://forum.ionicframework.com/t/change-toast-close-button-and-text-css/153799/4 "2019-01-22T14:00:03Z")

</div>

try

```auto
.yourcssclass .toast-button-inner{ color: yourcolor; }

```

for button  
when i want to play with css  
I right click on the item and inspection, it gives me the different id that I need 😉

---

<div class="post-metadata">

**Author:** ![rhafiko](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/rhafiko/32/122480_2.png) [@rhafiko](https://forum.ionicframework.com/u/rhafiko)\
**Post date:** [June 17, 2019, 1:49pm UTC](https://forum.ionicframework.com/t/change-toast-close-button-and-text-css/153799/5 "2019-06-17T13:49:56Z")

</div>

the solution which worked for me was:

```auto
        let toast = this.toastCtrl.create({
          message: 'your toast message text',
          duration: 3000,
          cssClass: 'toast-error',
          showCloseButton: true,
          closeButtonText: 'Undo'
        });

```

and in my css file:

```auto
page-my.page.scss.name {
        // my regular css code
}

.toast-error .button-inner {
    color: color($colors, danger);
}

```
