1
I have the following code below
let alert = this.alertCtrl.create({
message: '<div><img height="50" src="assets/imgs/success.png"></div><div>' +
'<p>Cadastrado com sucesso!!!</p>' +
'</div>',
buttons: [{
text: 'OK',
handler: data => {
console.log('Ok clicked');
}
}]
});
alert.present();
Where I’m using importing the AlertController
in this way:
import { AlertController } from 'ionic-angular';
See the image as it looks:
I would like to centralise the content of AlertController
, but I tried in some ways but it doesn’t work, like for example in this way, but does not recognize.
Is there any way to centralize the content of div
in the AlertController
?
How exactly would you like it to look? You have 2 Divs elements 1 img element and a p element, I didn’t understand which exactly you want to align in the center, is horizontal vertical center or both?
– MagicHat
@Magichat align everything. By the way, except the OK button. Or maybe also. huehe
– viana
I don’t know how you try : <div style="width:70%;float:None;display:block;margin:0 auto;text-align:center;"><img height="50" src="Assets/imgs/Success.png">' + '<p>Registered successfully!!! </p></div>'...
– MagicHat
@Magichat had already tried so, but it doesn’t work.
– viana