Henrietta Read Henrietta Read - 6 months ago 19
HTML Question

How to center KineticJS stage in webpage

Trying to center a KineticJS stage in webpage.

Tried:

<div style="text-align: center">
<div id="container"></div>
</div>


but it centers on the left side of stage, no the middle of the stage. what am I missing?

Answer
<div>
  <div id="container" style="width:600px;border:1px solid gray;margin:auto;height:200px;"></div>
</div>

margin:auto can align this div center