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 6915671
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:30:16+00:00 2026-05-27T09:30:16+00:00

This is new for me: only inline elements are allowed in <p> </p> ,

  • 0

This is new for me: only inline elements are allowed in <p> </p>, in HTML. Then how can I make captions for images in my HTML paragraphs? I have this, but it uses a div, which is not allowed in <p>:

<div class='image floatright' style='width:228px;margin:0 0 0 10px;'>
  <a rel='article' href='images/articles/comenius_logo.jpg' title=''>
    <img style='width:218px' src='images/articles/comenius_logo.jpg' alt='' />
  </a>
  Caption of the image
</div>

I could place this outside the paragraph, but then it would be at the top, which I don’t always want.
And I also could use divs instead of paragraphs, but then the semantics of the html source code would be lost.

I don’t know what I can do :\ All of the solutions I have found use block elements, like table, div, figure, etc.

  • 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-05-27T09:30:17+00:00Added an answer on May 27, 2026 at 9:30 am

    You can replace <div> with a <span>, then style it using display:block;. The <span> is still an inline element (even if it looks like a block-level element), thus passes the HTML validation.

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

Sidebar

Related Questions

I'm doing some tests with new features of CSS3, but this combination only works
In Java you can define a new class inline using anonymous inner classes. This
I recently got a shiny new development workstation. The only disadvantage of this is
I'm using gtk.combo_box_new_text() to make combobox list, this uses a gtk.ListStore to store only
when ever i use window.location.href=//some url it always open a new window, this only
I just started to read about this new technology... Does someone have some knowledge
I can't tell if this is a result of the jQuery I'm using, but
This error is only present in Internet explorer but works in Mozilla so far.
I would look this up on Google/MSDN, but I have no idea what it's
I have multiple paragraphs of text in an HTML document. Also, at various points,

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.