# How write html in BABYLON.GUI.Rectangle

**URL:** <https://forum.babylonjs.com/t/how-write-html-in-babylon-gui-rectangle/28415>\
**Category:** Questions\
**Created:** [March 14, 2022, 1:13pm UTC](https://forum.babylonjs.com/t/how-write-html-in-babylon-gui-rectangle/28415 "2022-03-14T13:13:23Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [March 14, 2022, 4:59pm UTC](https://forum.babylonjs.com/t/how-write-html-in-babylon-gui-rectangle/28415/3 "2022-03-14T16:59:09Z")

</div>

This problem has been discussed quite a few times on the forum before, such as:

- [HTML projection to object in scene - Demos and projects - Babylon.js (babylonjs.com)](https://forum.babylonjs.com/t/html-projection-to-object-in-scene/24850)
- [HTML in 3D Space Part 2 - BJS Way to Matrix Transform - Questions - Babylon.js (babylonjs.com)](https://forum.babylonjs.com/t/html-in-3d-space-part-2-bjs-way-to-matrix-transform/3214/3)
- [Rendering an iframe on Babylon - Questions & Answers - HTML5 Game Devs Forum](https://www.html5gamedevs.com/topic/34748-rendering-an-iframe-on-babylon/?tab=comments#comment-199779)

I think the easiest method would be to draw the HTML contents into a canvas using something like [rasterizeHTML.js by cburgmer](https://cburgmer.github.io/rasterizeHTML.js/) or this [Rendering HTML to an image - Ron Valstar - front-end developer](https://ronvalstar.nl/render-html-to-an-image), and then using that canvas as the input to a DynamicTexture [Dynamic Textures | Babylon.js Documentation (babylonjs.com)](https://doc.babylonjs.com/divingDeeper/materials/using/dynamicTexture) which is the texture source of a Rectangle.

---

_[View the full topic](https://forum.babylonjs.com/t/how-write-html-in-babylon-gui-rectangle/28415)._
