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

  • Home
  • SEARCH
  • 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 7615271
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T02:36:16+00:00 2026-05-31T02:36:16+00:00

Why is there some strange spacing with <img/> tags in a paragraph <p> ?

  • 0

Why is there some strange spacing with <img/> tags in a paragraph <p>?

I noticed this from using firebug where the img is maybe 4-5 pixels above where the text should be inline.

Example:
http://jsbin.com/epavij

Here the <a> tag is surrounding the <img/> and the <a> is shown to take up a smaller space down a few pixels.

Obviously display:block fixes this problem, but what is causing it?

For argument’s sake I plan to have the image inline with some text; though I have tested, and adding text does not fix the problem.

  • 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-31T02:36:17+00:00Added an answer on May 31, 2026 at 2:36 am

    this happens because of “baseline” which happens to elements that are inline. “baseline” is the default (correct me if i’m wrong) vertical-alignfor elements, most notably for inline elements (like span and anchors)

    to show you what i mean, try placing text like the letters “qfx” right beside the image. you will notice that the bottom of the image is in line with the bottom of “x”. that’s the baseline alignment – on which your <img> tag is sitting on.

    but the anchor tag will occupy until the bottom of “q”. anchor tags will occupy beyond the baseline, until the bottom.

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

Sidebar

Related Questions

There is some strange behaviour in parsing KML produced by Google Earth using a
So I noticed some strange behavior when using a subclass of a NSManagedObject as
I am using XOM to canonicalize some XML. But there are some strange characters
Is there some kind of tool for creating user interfaces using ATL for C/C++?
For some strange reason, an alert dialog with the text title Message From Web
I'm having a strange issue with some @font-face text where there is some strange
Hi I found that there are some strange symbol in the invoice's PDF(Sales >
It seems like a strange convenience property, only saving one character. Is there some
there are strange characters at the beginning of a file I'm editing (using textmate..)
while i'm debugging my app there is some strange things. In some point the

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.