Computer Applications

Why is it important to specify an image width and height in an <img> tag ?

  1. It ensures that a user will not be able to copy the image to their computer.
  2. The image will not render if these attributes are left out.
  3. These attributes constrain the image's proportions.
  4. Specifying these dimensions helps a browser render pages faster.

HTML Advanced Features

2 Likes

Answer

Specifying these dimensions helps a browser render pages faster.

Reason — Specifying the width and height of the image enables the browser to reserve space before actually downloading the image, speeding document rendering and eliminating the content shifting.

Answered By

2 Likes


Related Questions