# Centering DOM elements

**URL:** <https://phaser.discourse.group/t/centering-dom-elements/2957>\
**Category:** Phaser 3\
**Created:** [July 1, 2019, 8:36am UTC](https://phaser.discourse.group/t/centering-dom-elements/2957 "2019-07-01T08:36:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dylan\_HC](https://avatars.discourse-cdn.com/v4/letter/d/6f9a4e/32.png) [@Dylan\_HC](https://phaser.discourse.group/u/Dylan_HC)\
**Post date:** [July 1, 2019, 8:36am UTC](https://phaser.discourse.group/t/centering-dom-elements/2957/1 "2019-07-01T08:36:08Z")

</div>

Hello,

I am currently working on a game which needs some user’s input and to be responsive. That’s why I choose to use DOM elements. My problem is that some of them are not displaying at the right place.

My panels are placed this way :

MyVar = this.add.dom(game.canvas.width/2, game.canvas.height/2).createFromCache(“Name-Of-HTML-Element”);

That code works for most of them, but there is one who seems to be displayed like :

…(game.canvas.width, game.canvas.height/2)…

The css classes used are the same on all the panels… that’s where I am stuck.

 ![image%20(2)](https://global.discourse-cdn.com/free1/uploads/phaser1/original/2X/e/ece66a680b04c712764be40e3f9bfccd27ca3288.png)

Could you please help me with that ?  
Maybe that I misunderstood something about DOM Elements ?

Thanks for reading me !
