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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:33:06+00:00 2026-06-04T04:33:06+00:00

Below I have a h3 tag inside a div. #one { width:300px; height:200px; background-color:black;

  • 0

Below I have a h3 tag inside a div.

#one {
  width:300px;
  height:200px;
  background-color:black;
  color:white;
}

h3 {
 margin-top:20px;
}

    <div id="one">
<h3>Coming Soon My Tools</h3>
</div>​

When rendered the top margin of the div is being moved instead of the top margin of the h3 tag. see demo http://jsfiddle.net/EnigmaMaster/aZnjx/1/

Does anyone know why this happens?

If I put something inside the div before the h3 tag then the margin adjusts properly, also if I add display: inline-block to the h3 tag it renders properly then also. Im not looking for a solution to my problem. Im looking for info on the issue. Has anyone else ran into this issue before?

  • 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-04T04:33:07+00:00Added an answer on June 4, 2026 at 4:33 am

    I can’t find the information now that supports my idea, but as far as I know, the div is a box with no margins. So you would get a ‘margin collapse’ of the div margins and the h3 margins. If you add any text between the div and the h3 tag, you actually create a new block and the h3 margin is added as an offset to that block.
    Same goes for adding a 1px border to the div. The ‘collapse’ behavior disappears then.
    As said, I can’t find the information that supports this, but fiddling around with your url demonstrates the behavior.

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

Sidebar

Related Questions

I have this form tag below where the form submits to itself which I
I have used the code below to read rfid tag values. try { if
If any of the nested div s below have a length longer then an
I have seen at couple of places people using the inside the tag to
I'm trying to get dynamic height with below paragraph. <td> <b>audio systems</b> <br> <div
I have the following div tag, which will be created onload by jquery. I
I have a list of post links that have tags inside an inner div.
I have a JQuery Accordion as below; <div id=accordion> <h3 class=ui-accordion-header><a id=link1 href=#>First Header</a></h3>
I have an anchor tag inside a <li> tag like this <li><a href=#fragment-1>Primary Details</a></li>
I have a dropdown box and a literal tag inside an Update Panel. On

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.