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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T19:03:55+00:00 2026-05-22T19:03:55+00:00

This is probably basic stuff, so if there’s some kind of online reference for

  • 0

This is probably basic stuff, so if there’s some kind of online reference for how html text & margins work, please just throw me a link.

Anyway, I’m having some trouble defining exact margins for text. Below is an example of an image, a div containing text below it and more text below the div. Other margins are set to 0, and margins for the div is 10px top & bottom, 0 left & right. For reasons unknown to me, it turns out 16px top, 14px bottom. I could just compensate the error with the margin definitions, but I would actually like to know what’s going on instead of treating the symptoms.

<img src="images/temp/img.png" />
<div><p>Testing</p></div>
<h2>Siirry</h2>

And style for the div is

div {
    color:#f00;
    text-transform:uppercase;
    font-size:9px;
    line-height:9px;
    height:9px;
    margin:10px 0;
    overflow:hidden;
}

Example image:

Example

EDIT:

More info since my point didn’t apparently come out very clearly:
The margin is 10px according to tools such as Firebug. That is not what I’m asking. However because of the way the fonts are rendered, the box of the text is actually larger than the actual size of the text. This causes the VISUAL margin to be larger than the defined margin (which you can verify by measuring it in Photoshop or simnilar software). I’m looking for information about the relation between text’s box size and actual size, so I can define margins properly.

  • 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-22T19:03:56+00:00Added an answer on May 22, 2026 at 7:03 pm

    That’s because the font doesn’t use the entire height. A better (though maybe not perfect) indication would be to select the text and check the margins between the black border and the highlighted rectangle. And that goes for the text below ‘testing’ too. It will occupy part of those 14px.

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

Sidebar

Related Questions

OK, this is probably pretty basic stuff, but it took me quite some time
I'm a noob so this is probably basic stuff, but I have tried to
This is probably a basic html/css question... I have a simple one-button form that
This is probably very basic stuff, but please bear in mind I am completely
This is probably basic stuff, but I can't find the clear answer anywhere.. Lets
Probably this is a basic stuff, but better learn now then later. What i'm
This is probably very basic stuff but I'm stuck and a bit clueless. I
Ok so I am just practicing what is probably some very basic stuff with
This is probably a pretty basic question, but just something that I wanted to
This is probably basic, but I can't find a solution. I have a string,

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.