The Essential Guide to HTML5

(Greg DeLong) #1

CHAPTER 10


Code Explanation

body { Specifies the style for the body
element

background-color:white; Sets the background color

color: black; Sets the color of the text

font-size:18px; Sets the font size

font-family:Verdana, Geneva, sans-serif; Sets the font family

} Closes the style

footer { Specifies the style for the footer

display:block; Treats this element as a block

font-family:Tahoma, Geneva, sans-serif; Sets the font family

text-align: center; Aligns the text in the center

font-style:oblique; Makes the text slanted

} Close style

header { Specifies the style for the header

width:100%; Make it take up the whole window

display:block; Treats it as a block

} Close style

</style> Close the style element

<script> Starts the script element

var cwidth = 800; Sets the width of the canvas; used
when clearing the canvas

var cheight = 600; Sets the height of the canvas; used
when clearing the canvas
Free download pdf