Jump to content

How to have a canvas appear where I want it?

Recommended Posts



I am injecting a js script using a code block. The block draws a canvas and displays stuff on it. The problem I am having is that the canvas I draw appears in a totally wrong place.

For reference, I want the canvas to appear where the red box is, but it appears all the way down close to the page's footer. What am I doing wrong?


The html code is super simple. it goes:





Link to comment
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Posted Images

Once again I answer myself. 

The problem I was having was specific to the p5 library. Creating canvases works just fine. 

For reference, I solved the problem by creating a div in the html code and setting it as the parent of the processing canvas.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.