HTML and CSS Reference
In-Depth Information
setupgame function if you want the player to start with a blank page and not with the representation of the
wooden beams of the gallows.
The complete implementation of Hangman is shown in Table 9-2.
Table 9-2. The Complete Implementation of Hangman
Code
Explanation
<html>
Opening tag
<head>
Opening tag
<title>Hangman</title>
Completes the title element
<style>
Opens the style element
.letters {position:absolute;left: 0px;
top: 0px; border: 2px; border-style: double;
margin: 5px; padding: 5px; color:#F00;
background-color:#0FC; font-family:
"Courier New", Courier, monospace;
Specifies styling for any element with
designated class letters, including the border,
colors, and font
}
Closing style directive
.blanks {position:absolute;left: 0px;
top: 0px; border:none; margin: 5px;
padding: 5px; color:#006; background-color:
white; font-family:"Courier New", Courier,
monospace; text-decoration:underline; color:
black;
Specifies styling for any element with
designated class blanks, including the border,
spacing, color, and font, and puts in
underlines
}
Closing style directive
</style>
Closes the style element
<script src="words1.js" defer></script>
Element calling for inclusion of external file,
with directive to load the file at same time as
the rest of this document
<script >
Opening tag for the script element
var ctx;
Variable used for all drawing
var thingelem;
Variable used for created elements
Search WWH ::




Custom Search