HTML and CSS Reference
In-Depth Information
3. Under the File menu in Chrome, Safari, or Firefox, you should find the option
Open File. Click that selection. You should then see a box to open a file. (On
Windows using Chrome, you might need to press Ctrl+O to open a file.)
4. Locate the CH1EX1.html that you just created.
5. Click Open.
You should see something similar to Figure 1-1 .
Figure 1-1. HTML Hello World!
This is one of only two examples in this entire topic that will work with
Internet Explorer 8 or earlier.
Basic HTML We Will Use in This Topic
Many HTML tags can be used to create an HTML page. In past versions of HTML,
tags that specifically instructed the web browser on how to render the HTML page
(e.g., <font> and <center> ) were very popular. However, as browser standards have
become more restrictive in the past decade, those types of tags have been pushed aside,
and the use of CSS (Cascading Style Sheets) has been adopted as the primary way to
style HTML content. Because this topic is not about creating HTML pages (i.e., pages
that don't have Canvas in them), we are not going to discuss the inner workings of CSS.
We will focus on only two of the most basic HTML tags: <div> and <canvas> .
<div>
This is the main HTML tag that we will use in this topic. We will use it to position
<canvas> on the HTML page.
Example 1-2 uses a <div> tag to position the words “Hello World!” on the screen, as
shown in Figure 1-2 .
Figure 1-2. HTML5 Hello World! with a <div>
 
Search WWH ::




Custom Search