The colorful web pages I saw today are all because of the effects of images. Think about it, the web pages on the Internet are all plain text, which is very boring, and you will know the importance of images in web design. Images can be inserted in html pages. The commonly used image formats on web pages are JPEG and GIF:
JPEG (Joint Photographic Experts Group) is an extraordinary file format designed for photo images. JPEG supports millions of colors. JPEG is a quality lossy format, which means that some image data is lost during compression, which reduces the quality of the final file. However, the image data is discarded very little and there will be no very significant difference in quality.
Graphic exchange format GIF is a very popular format in web images. While it includes only 256 colors, the GIF provides excellent, almost no loss of image compression. And GIFs can contain transparent areas and multiple animations. It compresses by scanning pixel rows horizontally to find a fixed color area, and then reduces the number of pixels in the same area. Therefore, GIF is usually suitable for cartoons, graphics, logos, graphics with transparent areas, animations, etc.
Inserting pictures into the page can beautify it. There is only one tag to insert the picture, that is the <img> tag. When inserting an image, it is not enough to just use the <img> tag, and it needs to be completed with other attributes, as shown in the following table.
| property | describe |
|---|---|
| src | Image source file |
| alt | Prompt text |
| width,height | Width, height |
| border | frame |
| vspace | Vertical spacing |
| hspace | Horizontal spacing |
| align | arrangement |
| dynsrc | Set the playback of avi file |
| loop | Set the number of times avi file plays loop |
| loopdelay | Set the loop playback delay of avi file |
| start | Set the avi file playback method |
| lowsrc | Set low resolution pictures |
| usemap | Image map |
By specifying the path of the image source file with the src attribute, the image insertion can be completed.
Specify the path through the src attribute, and File_name is the path to insert the image.
Insert the image through the src attribute marked with <img>.
01 <!-- ------------------------------ -->
02 <!-- File example: 9-1.htm -->
03 <!-- File description: Insert picture-->
04 <!-- ------------------------------ -->
05 <html>
06 <head>
07 <title>Insert picture</title>2 pages in total Previous page 12 Next page