hamburger menu
All Coursesall course arrow
adda247
reward-icon
adda247
    arrow
    arrow
    arrow
    < HTML> < HEAD> < TITLE>HTML Sample< /TITLE> < /HEAD> < /HTML> In the above given HTML code segment you
    Question

    < HTML>
    < HEAD>
    < TITLE>HTML Sample< /TITLE>
    < /HEAD>
    < /HTML>
    In the above given HTML code segment you need to add an image file in the next paragraph. Which code segment will you use for this?

    A.

    < P>
    < IMAGE height="100%" width="100%"
    src="Sample.gif">
    < /P>

    B.

    < A>
    < IMG height="100%" width="100%" src="Sample.gif">
    < /A>

    C.

    < P>
    < IMG height="100%" width="100%" src="Sample.gif">
    < /P>

    D.

    < P>
    < IMAGE="Sample.gif">
    < /P>

    Correct option is C

    The correct HTML element for displaying an image is <img>, not <image>.
    Placing the <img> inside <p>...</p> inserts the image within the next paragraph as requested.
    src specifies the image file (Sample.gif), while height and width control its rendered size (here, 100% of the containing block).
    Option (a) and (d) are invalid because <image> is not an HTML tag.
    Option (b) wraps the image in an anchor <a> without an href and does not create a paragraph.
    Hence, (c) is the valid and semantically appropriate choice.
    Important Key Points

    1. Tag to use: <img> is the correct self-closing/void element for images in HTML.
    2. Inside a paragraph: Wrapping <img> with <p>...</p> places it in a paragraph block.
    3. Attributes: src is required; height/width accept pixels or percentages relative to the container.
    4. Accessibility: Prefer adding alt="..." to describe the image for screen readers and broken-image cases.
    5. Void element: <img> has no closing tag; write <img ...> (HTML) or <img ... /> (XHTML-style).
    6. Responsive tip: Often better to control sizing via CSS (e.g., max-width:100%; height:auto;).

    Knowledge Booster

    • Why (a) & (d) are wrong: <image> is not defined in HTML; browsers won’t recognize it.
    • Why (b) isn’t suitable: <a> without href is not a link and does not create a paragraph; requirement was specifically to add the image in the next paragraph.
    • Best practice: Use semantic HTML and CSS for layout; include alt text and consider loading="lazy" for performance.

    Free Tests

    Free
    Must Attempt

    Government Policies and Scheme

    languageIcon English
    • pdpQsnIcon10 Questions
    • pdpsheetsIcon20 Marks
    • timerIcon5 Mins
    languageIcon English
    Free
    Must Attempt

    Government Schemes

    languageIcon English
    • pdpQsnIcon10 Questions
    • pdpsheetsIcon20 Marks
    • timerIcon5 Mins
    languageIcon English
    Free
    Must Attempt

    SSC GD PYP (Held on 4 Feb 2025 S1)

    languageIcon English
    • pdpQsnIcon80 Questions
    • pdpsheetsIcon160 Marks
    • timerIcon60 Mins
    languageIcon English
    TEST PRIME

    Access ‘UPSSSC’ Mock Tests with

    • 60000+ Mocks and Previous Year Papers
    • Unlimited Re-Attempts
    • Personalised Report Card
    • 500% Refund on Final Selection
    • Largest Community
    1 month
    students-icon
    368k+ students have already unlocked exclusive benefits with Test Prime!
    Our Plans
    Monthsup-arrow