Here’s a fiddle: link
and more official documentation: link
const config = {
type: Phaser.AUTO,
width: 800,
height: 600,
parent: 'game_div',
scene: {
create: create,
},
dom: {
createContainer: true
}
};
const game = new Phaser.Game(config);
function create(){
const c = document.createElement('div');
c.style = "color:red;"
c.innerHTML = '<i>Hello</i> Phaser';
this.add.dom(100, 100, c);
}
Good luck!