|
|
IMAGES So far you can build a web page with text and links! Are you feeling cool yet? You can modify the text to look how you want it to look, but you havent yet learned how to make your pages into fine shining examples of heavenly art. Youre going to need some color, and images. Without further delay, let the web design course continue to: Background ColorSetting a background color is easy. Remember how the <font> tag had modifiers, like COLOR, SIZE, and FACE? The modifiers affected the font tag, and were listed inside the tag itself (example: <font color="red">). Some other tags also have modifiers, and background color is a modifier for the <body> tag. It is important to keep in mind that you can only have one body tag. You are going to add the background color modifier to the existing body tag. A body tag that includes a background color looks like: <body bgcolor="whatever_color"> Remember the "one command, one word" rule about modifiers? In HTML, each command is its own separate word. Bgcolor sounds like it might be two words. Youre telling the web page to change color, which is only one command. On command, one word. So, bgcolor is one word. Open up an HTML page and change the background color. Experiment. Have fun Be careful with your background color choices. Remember that the web is still a written medium. Its very hard to read over glaring yellow. Image Types for the WebOf course youll want some pictures to spice up your website. Images are used as buttons, banners, and design elements. There are different types of image files for the web, If you use the wrong one, your web pages will look bad. Images compress in different ways to make their file size smaller so that they download more quickly. Different image types compress images in different ways and use different compression strategies that work better for different types of images. Luckily for you, its pretty easy to decide which compression type to use. Images and their compression types are easily identifiable by their three-letter file extension, immediately following the file name. .JPG(pronounced jay-pegg) JPG stands for Joint Photographers Expert Group. Although its not super necessary for you to memorize what all the initials for all the file types stand for, some people like to know. The compression method JPG uses works very well on an image that is (industry term coming) non-continuous tone. Tone means color, right? Continuous means "keeps right on going". So, "non-continuous tone" means colors that dont keep right on going. What were talking about here is a photograph. If you took a picture of my face, youd have one color here and another color there. JPG was designed to show color photographs on a computer. If you try to save a picture that is continuous tone as a JPG, itll look messed up. .GIF .GIF stands for, "Graphics Exchange Format". Later on we will get much deeper into the workings of the compression methods that different image types use, but for now, you should know that a GIF is generally intended to be used for images created on a computer, with solid colors and text. Here are some examples of images saved as correct and incorrect image types:
Okay, where should I get these images? Create
them yourself. Scan
them in. Get
images off of the web. Buy
a disk with images on it. Hire an Artist Now Ive got images, how do I place them in my web page? The tag you use to place an image in your web page is: <img src="whateverimage.gif (or) whateverimage.jpg"> People refer to this tag as the "image source" tag. Dont Forget About File Paths!Remember that youll need to give directions from your HTML page to the image you want to insert/ How would you write the tag to insert image.gif into page1.htm in the example below?
The tag would be <img src="images/image.gif"> Image Tag ModifiersThe image tag has some very important modifiers. You can use any or all of these modifiers in the same image tag. Height
and Width The
ALT tag ALIGN BORDER Remember that you can use any or all of these modifiers in the same image tag. Using Images as Links (Buttons) To use an image as a button, simply insert it between the opening and closing hyperlink tag. When an image is used as a link, the browser will automatically display a blue border around the image, unless you tell it not to with BORDER="0" <a href="somepage.htm"> <img src="somegraphinc.gif" border="0"> </a> Background ImagesImages can also be used in the background of a web page. When using an image-based background you have to be very careful about download time. A very large image will often take a long time to download. There are tricks you can use to keep file size small even if the image is large, though. Well learn those tricks later. Right now you should know that an image used as a background will tile itself until it covers the entire page. A users computer will download the small image quickly, and duplicate it using the processor. The image would continue duplicating until it covered the whole page. The tag used to add a background image is a modifier of the existing BODY tag: <body background="whateverimage.gif or .jpg"> Notice that the modifier is a different than BGCOLOR. You cannot have a background image and a background color. |