SAMS Teach Yourself HTML and CSS in 24 Hours
Authors: Oliver D. Morrison M
Published year: 2005
Pages: 36-37/345
Buy this book on amazon.com >>

Q&A

Q1:

I've created a web page, but when I open the file in my web browser I see all the text including the HTML tags. Sometimes I even see weird gobbledygook characters at the top of the page! What did I do wrong?

A1:

You didn't save the file as plain-text. Try saving the file again, being careful to save it as Text Only or ASCII Text. If you can't quite figure out how to get your word processor to do that, don't stress. Just type your HTML files in Notepad or TextEdit instead and everything should work just fine. (Also, always make sure that the filename of your web page ends in .html or .htm .)

Q2:

I have this HTML web page on my computer now. How do I get it on the Internet so that everyone else can see it?

A2:

Hour 4, "Publishing Your HTML Pages," explains how to put your pages on the Internet as well as how to get them ready for publishing on a local network or CD-ROM.

Q3:

I want "Fred's Fresh Fish" to appear both at the top of my page and on people's bookmark (or favorites) lists when they bookmark my page. How can I get it to appear both places?

A3:

Make a heading at the top of your page with the same text as the title, like this:

<html>
  <head>
    <title>Fred's Fresh Fish</title>
  </head>

  <body>
    <h1>Fred's Fresh Fish</h1>
    ...the rest of the page goes here...
  </body>
</html>


Q4:

I've seen web pages on the Internet that don't have <html> tags at the beginning. You said pages always have to start with <html>. What's the deal?

A4:

Many web browsers will forgive you if you forget to put in the <html> tag and will display the page correctly anyway. Yet it's a very good idea to include it because some software does need it to identify the page as valid HTML. Besides, you want your pages to be bona fide XHTML pages so that they conform to the latest web standards.



Workshop

The workshop contains quiz questions and activities to help you solidify your understanding of the material covered. Try to answer all questions before looking at the "Answers" section that follows .

Quiz

1:

What four tags are required in every HTML page?

2:

Insert the appropriate line-break and paragraph-break tags to format the following two-line poems with a blank line between them:


Good night, God  bless  you,
Go to bed and undress you.
Good night, sweet repose,
Half the bed and all the clothes.

3:

Write the HTML for the following to appear one after the other:

  • A small heading with the words "We are Proud to Present"

  • A horizontal rule across the page

  • A large heading with the one word, "Orbit"

  • A medium- sized heading with the words "The Geometric Juggler"

  • Another horizontal rule

4:

Write a complete HTML web page with the title "Foo Bar" and a heading at the top that reads "Happy Hour at the Foo Bar," followed by the words "Come on down!" in regular type.

Answers

A1:

<html> , <head> , <title> , and <body> (along with their closing tags, </html> , </head> , </title> , and </body> ).

A2:

<p>Good night, God bless you,<br />
Go to bed and undress you.</p>
<p>Good night, sweet repose,<br />
Half the bed and all the clothes.</p>


A3:

<h3>We are Proud to Present</h3>
<hr />
<h1>Orbit</h1>
<h2>The Geometric Juggler</h2>
<hr />


A4:

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
  "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  <head>
    <title>Foo Bar</title>
  </head>

  <body>
    <h1>Happy Hour at the Foo Bar</h1>
    Come on Down!
  </body>
</html>



SAMS Teach Yourself HTML and CSS in 24 Hours
Authors: Oliver D. Morrison M
Published year: 2005
Pages: 36-37/345
Buy this book on amazon.com >>

Similar books on Amazon