Skip to content

Instantly share code, notes, and snippets.

@Shujito
Last active July 15, 2023 04:50
Show Gist options
  • Save Shujito/7a522d857844fc019846c48d47b16494 to your computer and use it in GitHub Desktop.
Save Shujito/7a522d857844fc019846c48d47b16494 to your computer and use it in GitHub Desktop.
Ejemplo Canvas HTML5
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type="text/css">
html {
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
canvas { background: blue }
</style>
<title>Hola</title>
</head>
<body onload="main()">
<canvas width="640" height="480"/>
</body>
<script type="text/javascript">
function main() {
let canvas = document.getElementsByTagName('canvas')
console.log('canvas', canvas)
}
</script>
</html>
<!DOCTYPE html>
<html>
<script type="text/javascript">
console.log('Hi there!')
</script>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment