I'm currently working on creating a square canvas using CSS to ensure it is instantly sized when the page loads.
To achieve this, I am wrapping the canvas in a div and applying the following styles:
body {
background-color: blue;
}
#wrap {
width: 40%;
height: 0;
padding-bottom: 40%;
}
canvas {
background-color: white;
width:100%;
height:100%
}
Unfortunately, I'm facing an issue where nothing is being displayed. When I manually set specific widths for the wrap using pixels or percentages, the canvas shows up. I believe I might be overlooking a simple detail, but I can't pinpoint what it is.