Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8742985
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:35:51+00:00 2026-06-13T11:35:51+00:00

I was once told that the img tag in html had to be nested

  • 0

I was once told that the “img” tag in html had to be nested within an element such as the p tag. Is this true? or was mislead?

<p><img src "img/mittromneylittleface.png" alt="drinks" /></p>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T11:35:52+00:00Added an answer on June 13, 2026 at 11:35 am

    Well if you were once told that, you were told this in the context of HTML 4. Take a look at the DTD for HTML 4 Strict here.

    You will see that IMG is an %inline element, but the HTML BODY element can only contain %block, SCRIPT, INS, and DEL elements:

    <!ELEMENT BODY O O (%block;|SCRIPT)+ +(INS|DEL) -- document body -->
    
    <!ENTITY % block 
       "P | %heading; | %list; | %preformatted; | DL | DIV | NOSCRIPT |
        BLOCKQUOTE | FORM | HR | TABLE | FIELDSET | ADDRESS">
    

    So if you want to validate HTML 4 strict, you should definitely include the IMG inside a P or similar. Try it on a validator, you will see:

    document type does not allow element “IMG” here; missing one of “P”, “H1”, “H2”, “H3”, “H4”, “H5”, “H6”, “DIV”, “ADDRESS” start-tag

    Now, in HTML 5, you can have an img element right under the body element. Check out the definition of the body element here. It says the content model for the body element is:

    Flow content

    If you lookup Flow content, you will see that img is allowed!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been told that they do, but once the element with the CSS background
I was once told in a programming class that C++ had achieved a better
I've had a colleague that told me he once worked for a company that
My superior once told me that a bad way of calling a web service
I was told more than once that Delphi handles dynamic classes better than static.Thereby
An expert in highly optimized code once told me that an important part of
Sometime ago I asked this question and I was told that the entry has
I was once told that it is faster to just run an insert and
Problem is: I was told that there was once a code containing string SOMESTRING
A colleague once told me that the last option when everything has failed to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.