HTML and CSS Reference
In-Depth Information
In the index.html file, we will construct a basic HTML structure, which is shown as follows:
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<title>Multiply Defense</title>
<link rel="stylesheet" href="styles/game.css">
<div class="row">
<h1>Multiply Defense</h1>
<section id="game" class="row">
<section class="how-to-play row">
<h2>How to Play?</h2>
<p>Run as far away as possible.</p>
<div class="row">
<p>Copyright goes here.</p>
<script src="vendors/easeljs-0.7.1.min.js"></script>
<script src="scripts/game.js"></script>
Engage thrusters
It's ime to deine the canvas of the game and the component's skeleton.
1. First, let's put a canvas element into our HTML file:
<section id="game" class="row">
<canvas id="canvas" width="300" height="480"></canvas>
2. In CSS, we set the dimension of the game's secion and basic posiioning for both
the game and canvas elements:
#game {
position: relative;
width: 300px;
Search WWH ::

Custom Search