Is it possible to add a div on top of the application canvas

Hello

Like adding a custom div/popup ui on top of a published playcanvas project inside the html.

I tried adding a html div to display on top of the canvas but it does not appear even though it shows in the elements in developer tools.

Thanks

Hi @nasjarta,

Most likely your CSS rules aren’t correct. Check this example on how it adds a div and styles it to show in front of the canvas:

https://developer.playcanvas.com/en/tutorials/htmlcss-ui/

2 Likes

Wow thanks for this link Leonidas its really helpful!

Also do you know how I can add an external css library into playcanvas. Like for example I can add external scripts in editor but can I do the same for an external css?

Thanks

Yes, you can add a .css file and load it in your code like this:

https://developer.playcanvas.com/en/user-manual/assets/css/

1 Like