Head first HTML and css-to add images to your page

Source: Internet
Author: User
Tags transparent image

  1. In HTML we use IMG tags to insert images, commonly used in the Web three kinds: JPEG, png,gif.

In simple terms, JPEG is suitable for photos and complex images, while PNG or GIF is suitable for monochrome images, logos, and geometries.

  • JPEG: Suitable for continuous-tone images, such as photographs, can represent 16 million different color images; "lossy" format, which loses information when compressed, does not support transparency and animation; The file is small.
  • PNG: Suitable for monochrome images and lines composed of images, such as logo, clip art, small text in the image, can represent millions of colors, PNG has three kinds, PNG-8, PNG-24, PNG-32; "Lossless format", compression without loss of information, allow "Transparent", file is larger than JPEG, The number of colors to use, as compared to GIF.
  • GIF: Similar to PNG, suitable for monochrome images and lines of images, such as logo, clip art, small text in the image, can represent up to 256 colors, "lossless" format; only one color is allowed to be set to "transparent"; the file is larger than JPEG, and animation is supported.

2.

The element is an inline element, the SRC attribute specifies the location of the image file, and the ALT attribute is a meaningful description of the image.

3. If you place a transparent image on a Web page, make sure that the mask color of the graphic matches the background color of the Web page.

Head first HTML and css-to add images to your page

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.