Sams Teach Yourself HTML 4 in 24 Hours

Sams Teach Yourself HTML 4 in 24 Hours

By Dick Oliver

Workshop

Quiz

  1. How would you wrap text around the right side of an image, leaving 40 pixels of space between the image and the text?
  2. How could you insert exactly 80 pixels of blank space between two paragraphs of text?
  3. If you have a circular button that links to another page, how do you prevent a rectangle from appearing around it?
  4. What four attributes should you always include in every <img /> tag as a matter of habit?

Answers

  1. <img src="myimage.gif" hspace=40 vspace=40 align="left" />
    Text goes here.
    								
  2. Create a small image that is all one color and save it as nothing.gif with that color transparent. Then put the following tag between the two paragraphs of text:
    <img src="nothing.gif" width=1 height=80 />
    
  3. Use the border="0" attribute, like the following:
    <a href="another_page.htm"><img src="circle.gif" border="0" /></a>
    
  4. src, alt, width, and height. An example:
    <img src="fred.jpg" alt="fat fred" width="300" height="100">
    

Exercises

  • Try creating a page with the wildest layout you can manage with the HTML tags you've learned so far. If you're resourceful, you should be able to create a staggered diagonal line of images or place short sentences of text almost anywhere on the page.
  • Make a very large background—so big that people will see only one "tile" and you don't have to worry about it being seamless. Most Web browsers will display all foreground content (in front of the bgcolor you specify in the <body> tag) while the background image loads. Go ahead and play around with the creative possibilities that large backdrops open up.

Share ThisShare This

Informit Network