Positioning the image:
You can also change where you want your image to be positioned on the page. The most frequently used positions for images are left, right and center. To make an image centered, type this before the image tag:
<div align="center">

Everything typed after this will be centered, so now you need to type your image tags. When you have finished your image tag and no longer want everything centered, you simply end the center tag, like so:
</div>

To make something aligned to the left or right, you use the same code, but you would replace the word "center" with "left" or "right."

Background Images:
You can also make an image display as a background image instead of just having a solid color. This works well with simple, light-colored images. It livens up the page, yet you can still read the text clearly. To display an image as the background, you need to type:
<body background="http://www.neopets.com/mypicture.gif">

This will now display your image in the background.

Go to Previous Lesson Go to Next Lesson






ADVERTISEMENT