# How to add css to alertcontroller

**URL:** <https://forum.ionicframework.com/t/how-to-add-css-to-alertcontroller/77813>\
**Category:** ionic-v3\
**Created:** [January 30, 2017, 11:29am UTC](https://forum.ionicframework.com/t/how-to-add-css-to-alertcontroller/77813 "2017-01-30T11:29:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![vks\_gautam1](https://avatars.discourse-cdn.com/v4/letter/v/ed655f/32.png) [@vks\_gautam1](https://forum.ionicframework.com/u/vks_gautam1)\
**Post date:** [January 30, 2017, 11:29am UTC](https://forum.ionicframework.com/t/how-to-add-css-to-alertcontroller/77813/1 "2017-01-30T11:29:18Z")

</div>

i am trying this .but it is not showing any effect.  
i want title background color in red . and button in red .

```auto
let currentAlert = this.altctrl.create({
      title: "Hello",
      subTitle: "trying",
        cssClass:'alertDanger',
      buttons: ["OK"],
    });
    currentAlert.present();
```

is there way to add color to title background only

```auto
.alertDanger{
background-color: red;
color: blue;
button{
color: green;
}

```

---

<div class="post-metadata">

**Author:** ![aaronksaunders](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/aaronksaunders/32/13729_2.png) [@aaronksaunders](https://forum.ionicframework.com/u/aaronksaunders)\
**Post date:** [January 30, 2017, 3:03pm UTC](https://forum.ionicframework.com/t/how-to-add-css-to-alertcontroller/77813/2 "2017-01-30T15:03:19Z")

</div>

> **[Ionic Framework](https://ionicframework.com/docs/api/components/alert/AlertController/)**
>
> Ionic is the app platform for web developers. Build amazing mobile, web, and desktop apps all with one shared code base and open web standards

bottom of page is documentation you are looking for

---

<div class="post-metadata">

**Author:** ![vks\_gautam1](https://avatars.discourse-cdn.com/v4/letter/v/ed655f/32.png) [@vks\_gautam1](https://forum.ionicframework.com/u/vks_gautam1)\
**Post date:** [January 31, 2017, 10:48am UTC](https://forum.ionicframework.com/t/how-to-add-css-to-alertcontroller/77813/3 "2017-01-31T10:48:15Z")

</div>

those tags are giving me unusual behaviour.  
 ![image](https://global.discourse-cdn.com/ionicframework/original/3X/e/2/e21f1ecc29bd4fdfeea1c79f65a08ba1e14553e8.png)

i can’t click on option. it get disappeared.  
like if i click on shop type it get disappeared and other invisible option get appeared.  
i have 4 option in it.

---

<div class="post-metadata">

**Author:** ![vks\_gautam1](https://avatars.discourse-cdn.com/v4/letter/v/ed655f/32.png) [@vks\_gautam1](https://forum.ionicframework.com/u/vks_gautam1)\
**Post date:** [February 1, 2017, 8:48am UTC](https://forum.ionicframework.com/t/how-to-add-css-to-alertcontroller/77813/4 "2017-02-01T08:48:55Z")

</div>

my package json

```auto
"dependencies": {
    "@angular/common": "2.2.1",
    "@angular/compiler": "2.2.1",
    "@angular/compiler-cli": "2.2.1",
    "@angular/core": "2.2.1",
    "@angular/forms": "2.2.1",
    "@angular/http": "2.2.1",
    "@angular/platform-browser": "2.2.1",
    "@angular/platform-browser-dynamic": "2.2.1",
    "@angular/platform-server": "2.2.1",
    "@ionic/cloud-angular": "^0.9.1",
    "@ionic/storage": "1.1.7",
    "ionic-angular": "2.0.0",
    "ionic-native": "2.4.1",
    "ionicons": "3.0.0",
    "rxjs": "5.0.0-beta.12",
    "sw-toolbox": "3.4.0",
    "zone.js": "0.6.26"
  },
  "devDependencies": {
    "@ionic/app-scripts": "1.0.0",
    "typescript": "2.0.9"
  },

```

variable.sccs

```auto
$alert-md-button-background-color:#e30914;
 $alert-md-button-text-color:#FFFFFF;	
```
