What will be the output of the following HTML code snippet? <IMG…

2022

What will be the output of the following HTML code snippet?

<IMG SRC="FLOWER.JPG" HEIGHT="100" WIDTH="40" BORDER="10">

Answer: B. The image flower.jpg will be displayed with 100 pixel height, 40 pixel width, and a 10 pixel thick border.Concept: In HTML, the HEIGHT, WIDTH, and BORDER attributes of the <IMG> tag accept a plain numeric value with no unit suffix. When no unit is given, browsers…

  1. A.

    The image flower.jpg will be displayed with 100 pixel height, 40 pixel width, and a border with RGB code 10.

  2. B.

    The image flower.jpg will be displayed with 100 pixel height, 40 pixel width, and a 10 pixel thick border.

  3. C.

    The image flower.jpg will be displayed with 100 centimetre height, 40 centimetre width, and a 10 centimetre thick border.

  4. D.

    The image flower.jpg will be displayed with 100 millimetre height, 40 millimetre width, and a 10 millimetre thick border.

Attempted by 538 students.

Show answer & explanation

Correct answer: B

Concept: In HTML, the HEIGHT, WIDTH, and BORDER attributes of the <IMG> tag accept a plain numeric value with no unit suffix. When no unit is given, browsers interpret that number as a pixel (px) value by default — never as centimetres, millimetres, or a colour code. (A colour needs a separate attribute value format, such as a hex code, not a bare integer.)

Application: Trace the tag in this snippet: <IMG SRC="FLOWER.JPG" HEIGHT="100" WIDTH="40" BORDER="10">.

  • HEIGHT="100" → no unit given → interpreted as 100 pixels of height.

  • WIDTH="40" → no unit given → interpreted as 40 pixels of width.

  • BORDER="10" → no unit given → interpreted as a 10-pixel-thick border drawn around the image.

Cross-check: None of these three values carries a unit suffix (no "cm", "mm", or colour notation appears anywhere in the tag), so the centimetre and millimetre readings are ruled out by the same default-unit rule, and the RGB-code reading is ruled out because BORDER only ever sets a thickness, never a colour. The image therefore renders 100 px tall, 40 px wide, with a 10 px border — matching the pixel-only interpretation.

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Uppsc Polytechnic Lecturer 2025 Cs

Loading lesson…