1

I have the following page with a black canvas inside of it:

enter image description here

There, the main menu for a game will be displayed, and it needs to have both a registration and a login form on it. How do I position forms/input elements inside the canvas?

Jay Sullivan
  • 17,332
  • 11
  • 62
  • 86
corazza
  • 31,222
  • 37
  • 115
  • 186
  • possible duplicate of [can I put a html button inside the canvas?](http://stackoverflow.com/questions/4797748/can-i-put-a-html-button-inside-the-canvas) – Ruan Mendes Jun 14 '12 at 20:52

2 Answers2

4

You can place HTML elements on top of your canvas by using CSS. See the following post for more info:

Can I put an HTML button inside the canvas?

Community
  • 1
  • 1
lkaradashkov
  • 8,609
  • 1
  • 15
  • 12
  • The question doesn't really have a lot to do with the canvas, I believe any other element could be placed there. – corazza Jun 14 '12 at 20:47
  • 1
    Ahh gotcha - you could place HTML elements on top of your canvas using CSS. See this post: http://stackoverflow.com/questions/4797748/can-i-put-a-html-button-inside-the-canvas – lkaradashkov Jun 14 '12 at 20:49
2

You don't. In canvas you'll be handling the rendering of most of your elements.

If you want to use the DOM, you could always overlay those forms/input elements on top of the canvas with a position: absolute or something equivalent. But as for them actually being in the canvas, you're going to have to manually render them. Another poster already put some links down for canvas basics you can make some progress on.

DerekR
  • 3,886
  • 2
  • 23
  • 24