How to contain the game within a <div>?

How could I contain a whole MV game within a <div> element, so other parts of the page could be used for other stuff?(I know it is possible for pixi projects to do so, but I don't know exactly how and how hard would it be).

I had thought about using iframe as an alternative, but I think that If I were to host it on itch.io it wouldn't work(also, for the project i'm creating, even on PC it wouldn't work that well)
Im not sure but you might actually want to look at index.html because afaik that's the "webpage" that runs the game
Im not sure but you might actually want to look at index.html because afaik that's the "webpage" that runs the game
Yes, but the game seems to be drawn above the page, as an canvas element/webgl, so anything I add to the page will be under it(I've made some tests)

Thus I need a way to resize it to be the size of a div and positioned over one only, so I can use other parts of the page to build stuff
You can set the game to run inside a TD.
Press spoiler button to see the code.
Spoiler
Code:
 <body style="background-color: black">
 
    <TABLE>
        <TR>

        <TD width="15%"></TD>

        <TD width="70%"=>
           <script type="text/javascript" src="js/libs/pixi.js"></script>
           <script type="text/javascript" src="js/libs/pixi-tilemap.js"></script>
           <script type="text/javascript" src="js/libs/pixi-picture.js"></script>
          <script type="text/javascript" src="js/libs/fpsmeter.js"></script>
          <script type="text/javascript" src="js/libs/lz-string.js"></script>
          <script type="text/javascript" src="js/libs/iphone-inline-video.browser.js"></script>
          <script type="text/javascript" src="js/rpg_core.js"></script>
          <script type="text/javascript" src="js/rpg_managers.js"></script>
          <script type="text/javascript" src="js/rpg_objects.js"></script>
          <script type="text/javascript" src="js/rpg_scenes.js"></script>
          <script type="text/javascript" src="js/rpg_sprites.js"></script>
          <script type="text/javascript" src="js/rpg_windows.js"></script>
          <script type="text/javascript" src="js/plugins.js"></script>
          <script type="text/javascript" src="js/main.js"></script>
        </TD>

        <TD width="15%"></TD>

        </TR>
    </TABLE>
    </body>

You can also take a look at frames.
Frames can be rows or columns.
You can create frames into frames.
You can load different html files inside each frame.
https://www.w3schools.com/tags/tag_frame.asp


This is not supported in HTML5.

Found this:
https://stackoverflow.com/questions/18259232/alternative-for-frames-in-html5-using-iframes

Hope you get some ideas on how to do stuff.
You can set the game to run inside a TD.
Press spoiler button to see the code.
Spoiler
Code:
 <body style="background-color: black">
 
    <TABLE>
        <TR>

        <TD width="15%"></TD>

        <TD width="70%"=>
           <script type="text/javascript" src="js/libs/pixi.js"></script>
           <script type="text/javascript" src="js/libs/pixi-tilemap.js"></script>
           <script type="text/javascript" src="js/libs/pixi-picture.js"></script>
          <script type="text/javascript" src="js/libs/fpsmeter.js"></script>
          <script type="text/javascript" src="js/libs/lz-string.js"></script>
          <script type="text/javascript" src="js/libs/iphone-inline-video.browser.js"></script>
          <script type="text/javascript" src="js/rpg_core.js"></script>
          <script type="text/javascript" src="js/rpg_managers.js"></script>
          <script type="text/javascript" src="js/rpg_objects.js"></script>
          <script type="text/javascript" src="js/rpg_scenes.js"></script>
          <script type="text/javascript" src="js/rpg_sprites.js"></script>
          <script type="text/javascript" src="js/rpg_windows.js"></script>
          <script type="text/javascript" src="js/plugins.js"></script>
          <script type="text/javascript" src="js/main.js"></script>
        </TD>

        <TD width="15%"></TD>

        </TR>
    </TABLE>
    </body>

You can also take a look at frames.
Frames can be rows or columns.
You can create frames into frames.
You can load different html files inside each frame.
https://www.w3schools.com/tags/tag_frame.asp


This is not supported in HTML5.

Found this:
https://stackoverflow.com/questions/18259232/alternative-for-frames-in-html5-using-iframes

Hope you get some ideas on how to do stuff.
I tried those 2 ideas, and the iframe one almost worked(the first was still displaying stuff under the game) but there's a problem...

I wish to do this(that I asked how to in the topic) to be able to build a chat right next to the game, without opening a new window(Because I wish to host it on itch. io). But since each message received creates a new element within the page, browser renders the whole page again to do so, thus reloading the iframe.


Is there any other way?
Why not build the chat within the game itself ?

Original thread: https://forums.rpgmakerweb.com/threads/how-to-contain-the-game-within-a-div.106146/