|
The mechanics of producing Web pages, at its simplest, is to make
changes to an XHTML document with an editor then previewing those changes
in a
Web browser. Well learn these procedures by first setting up our
tools, using the template.html document,
then applying the steps to open, edit, save, and preview.
Lets prepare the tools:
- Open your text editor;
- From within your editor, navigate to your Web Projects directory
and open the template.html file
you previously saved;
- Open your Web browser;
- From within your browser, navigate to your Web Projects directory
and open the template.html
file.
Heres how the template.html
file will look in your browser:

This may not look very exciting to you right now but note three things:
- The comments are not displayed in the browser window;
- The text in the
<title> tag is displayed
in the title bar at the top of the browser;
- The browser window is blank because nothing has been entered
between the
<body> tags.
Remember that we are using the template.html document as a starting
point for subsequent XHTML documents. This will save us some typing
each time
we create a new XHTML document.
- First, lets create a new XHTML document with a new filename.
- Second, lets open up experiments.html in our Web
browser
so we can preview our changes.
We now have everything prepared to begin creating our very first Web
page!
| Editing and Saving the XHTML Document |
Adding, editing, and formatting text is done between the opening and
closing <body> tags. Lets go over the
basics by making some simple changes to our experiments.html document.
- First, lets change the title of our page by typing in My
Experiments Page between the opening and closing
<title>
tags.
- Second, type in Welcome to My First Web Page! between the
opening and closing
<body> tags.
After youve entered in this new information, this is what you
should see in your text editor:
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>My First XHTML Page</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
<!-- INFORMATION TO BE DISPLAYED BEGINS ON THE NEXT LINE -->
Welcome to My First Web Page!
<!-- INFORMATION
TO BE DISPLAYED ENDS ON THE PREVIOUS LINE -->
</body>
</html>
|
Save the document when youre finished.
Switch to your Web browser (which should still have experiments.html
loaded) and select the Refresh/Reload button or press
the F5 key.
You should now see the changes you made in both the browsers title
bar and window. If you see it, congratulations!
If not, go back and retrace your steps.
Those are the mechanical basics of editing and previewing your XHTML
documents. Heres a quick review:
- Use the template.html
document as the starting point for new XHTML documents;
- Open the XHTML document you are editing in both the text editor
and the Web browser;
- After making changes to your XHTML document, Save the document
before previewing;
- To preview changes in the Web browser, select the browsers Refresh/Reload
button.
We will now begin formatting XHTML documents in the next section entitled
Text Flow.
|