I created a kaboom.js application and I'm having trouble setting a background for it. I've searched online extensively and attempted different methods on my own, but nothing seems to be working.
(StackOverflow flagged my post as mostly code so I included this text)
My Code
index.html
:
<!DOCTYPE html>
<html>
<head>
<title>Kaboom!!!</title>
<meta charset="utf-8">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="viewport" content="width=device-width">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<style>
* {
margin: 0;
}
html,
body {
width: 100%;
height: 100%;
overflow: hidden;
background: green;
}
canvas {
display: block;
}
</style>
</head>
<body>
{{kaboom}}
</body>
</html>
main.js
:
import kaboom from "kaboom"
// JavaScript code snippet goes here...
What I Have Attempted:
- Using CSS (
background: green;
)- The background briefly appeared when the game was loading, but then disappeared