html - When to use IMG vs. CSS background-image? -


In which case it would be better to use an HTML IMG tag to display an image As opposed to CSS background-image , and vice versa?

Factors may include access, browser support, dynamic content, or any technical limit or applicability principles.

  1. Use H3> If you intend to make people and you want to include the image by default & Mdash;
  2. The image has a meaningful meaning, such as IMG (with alt text), such as This ensures that the meaning of the image can be sent to all user-agents including screen readers.

Practical Use of IMG

  1. Use IMG If you intend to people and you default to image Use
  2. Use IMG If you rely on browser scaling to render an image in proportion to text size.
  3. For the use of IMG .
  4. Use zerox with IMG to fill out your entire window.
    Note, this is no longer true with CSS3 background size; See # 6 below.
  5. You can use img instead of background-image .

How to use CSS background-image

  1. Use CSS background images if image. & Mdash;
  2. Use CSS background images while doing the paragraph / header for example. & Mdash;
  3. If you want to people and you do not want to include the image by default, then use background image
  4. if you download time If you need to improve, then use
  5. background-image .
  6. If you use background image , you need to have only one part of the picture visible with CSS sprites.
  7. Use the background image to fill the background image in order to fill your entire window in Background size: cover command.

Comments