Sams Teach Yourself HTML 4 in 24 Hours

Sams Teach Yourself HTML 4 in 24 Hours

By Dick Oliver

Workshop

Quiz

  1. Write the HTML to make it possible for someone clicking the words "About the authors" at the top of the page to skip down to a list of credits at the bottom of the page.
  2. Suppose your company has three employees and you want to create a company directory page listing some information about each of them. Write the HTML for that page and the HTML to link to one of the employees from another page.
  3. If your email address is bon@soir.com, how would you make the text "goodnight greeting" into a link that people can click to compose and send you an email message?

Answers

  1. Type this at the top of the page:

    <a href="#credits">About the authors</a>
    

    Type this at the beginning of the credits section:

    <a name="credits"></a>
    
  2. The company directory page would look like the following:

    <html><head><title>company directory</title></head>
    <body><h1>Company Directory</h1>
    <a name="jones"><h2>Jane Jones</h2>
    Ms. Jones is our accountant… etc.
    <a name="smith"><h2>Sam Smith</h2>
    Mr. Smith is our salesman.. etc.
    <a name="bharwaniji"><h2>R.K. Satjiv Bharwahniji</h2>
    Mr. Bharwahniji is our president… etc.
    </body></html>
    

    If the file were named directory.htm, a link to one employee's information from another page would look like the following:

    <a href="directory.htm#bharwaniji">About our president</a>
    
  3. Type the following on your Web page:
    send me a <a href="mailto:bon@soir.com">goodnight greeting</a>!
    

Exercises

  • When you link back to your home page from other pages, you might want to skip some of the introductory information at the top of the home page. Using a link to a named anchor just below that introductory information will avoid presenting it to people who have already read it, making your pages seem less repetitive. Also, if any pages on your site are longer than two screens of information when displayed in a Web browser, consider putting a link at the bottom of the page back up to the top.
  • Look through your Web pages and consider whether there are any places in the text where you'd like to make it easy for people to respond to what you're saying. Include a link right there to your email address. You can never provide too many opportunities for people to contact you and tell you what they need or think about your products, especially if you're running a business.

Share ThisShare This

Informit Network