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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:35:22+00:00 2026-05-26T06:35:22+00:00

I have a span wrapping a img element and another span element, which is

  • 0

I have a span wrapping a img element and another span element, which is used for the description of the image. I want the image to be on top and then some text below the image.
I found a way using firefox specific css properties, but this wont work on any other browser. Is there another way to get this effect or mimic how it looks in firefox?

HTML:

 <span class="image">
   <img class="" alt="pic" src="pic.jpg" />
     <span class="img-desc">
       Call us today!
       <span>888-888-8888</span>
     </span>
  </span>

CSS:

 .image {
    float: right;
    width: -moz-min-content;
}
  • 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-26T06:35:22+00:00Added an answer on May 26, 2026 at 6:35 am

    Change all of your <span>‘s into <div>‘s and it will work. That’s because, by default, a <div> (block level) will cause line-breaks before & after itself, where a <span> (inline) does not.

    http://jsfiddle.net/TbY4N/

    <span>‘s were designed for “inline” use and, generally, you shouldn’t see them containing a bunch of other tags or block level elements. Although, you can easily force them to behave like <div>‘s (block level), this is an issue of proper semantics.

    Span versus Div according to the W3C wiki article…

    “The div element, short for division, is the block level generic
    container. It is normally used to wrap around other block level
    elements
    , to group them together (see the next section for more of
    an exploration of this). It can also be used to collect together a
    bunch of inline elements and/or text that otherwise don’t logically
    fit under another block level element, but this should be a last
    resort.”

    “The span element is the inline level generic container. It also
    helps to inform the structure of document, but it is used to group
    or wrap other inline elements and/or text, rather than block level
    elements.
    “

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

Sidebar

Related Questions

Suppose I have a span: <span class=myspan></span> .myspan{ background: url(image.png) top left no-repeat; }
I have span element <span class=tag onclick=clickTag(this) tagType=property> Which calls the clickTag method function
I have a Span tag containing a IMG tag and another Span tag. I
I have two span elements. I want them to sit side-by-side and contain some
I have a span element inside a table td element. The span tag has
I have WPF Span that is used as a source to a TextBlock. I
I have a form which is in an updatePanel and I have a span
I have the following: $(span.findme).each(function() { $(<li>).text($(this).text()).appendTo(ul); }); How can I, using the above,
I have a span element as follows: <span id=download>Download</span> . This element is controlled
I have some HTML as such: <span class=number>1.</span>Lorem ipsum dolor. <span class=special>Sit amet.</span> Consectur

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.