Sams Teach Yourself HTML, CSS & JavaScript Web Publishing in One Hour a Day

(singke) #1
ptg16476052

Summary 237

9


Image Etiquette


There are great images on sites all over the Web: cool icons, great photographs, excellent
line art, and plenty of other graphics, too. You might feel the temptation to link directly
to these images and include them on your own pages or save them to disk and then use
them. There are a number of reasons why it’s wrong to do so.


First of all, if you’re linking directly to images on another site, you’re stealing band-
width from that site. Every time someone requests your page, that person is also issuing
a request to the site where the image is posted and downloading the image from there. If
you get a lot of traffic, you can cause problems for the remote site.


The second reason is actually a problem regardless of how you use images from other
sites. If you don’t have permission to use an image on your site, you’re violating the
rights of the image’s creator. Copyright law protects creative work from use without per-
mission, and it’s granted to every creative work automatically.


The best course of action is to create your own images or look for images that are explic-
itly offered for free use by their creators. Even if images are made available for your use,
you should download them and store them with your web pages rather than linking to
them directly. Doing so prevents you from abusing the bandwidth of the person providing
the images.


Summary


In this lesson you learned to place images on your web pages. Those images are normally
in GIF, JPEG, PNG, or SVG format and should be small enough that they can be down-
loaded quickly over a slow link. You also learned that the HTML tag enables you
to put an image on a web page either inline with text or on a line by itself. The tag
has two primary attributes supported in standard HTML:


src The location and filename of the image to include.
alt A text string to substitute for the image in text-only browsers.

You can include images inside a link tag () to treat them as links. You also learned
how to display images on a page using CSS, as backgrounds for elements or as list
bullets.

← Previous
Free download pdf