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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:29:28+00:00 2026-05-27T10:29:28+00:00

So it is fairly well known that you can add a background image to

  • 0

So it is fairly well known that you can add a background image to the HTML tag and the BODY tag to get a double background effect without adding extra div elements. I love that you can do this, but when I attempt it extra margin gets added to the top of the BODY element.

I did find that if you added the following code:

*{
    margin: 0;
}

it will get rid of this margin, but it also makes it so I have to reset all the other elements that I didn’t want to get rid of margin on.

Does anyone know of a way to just get rid of the HTML tag margin.

This:

html {
    margin: 0;
}

doesn’t work BTW. It seems to be something else causing the extra spacing.

UPDATE:
Here is the JS Bin example. http://jsbin.com/ebefah/2

I am running an HTML5 doctype and I have gotten rid of the margin on the body as well.

ANSWER:
Thank you to thirtydot. The answer was the H1, due to collapsing margins. Once I got rid of the top margin on the H1 it all worked flawlessly. Thank you again!

  • 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-27T10:29:29+00:00Added an answer on May 27, 2026 at 10:29 am

    The gap is coming from the h1 (which has some margin-top by default), due to the effects of collapsing margins.

    Read this.

    You possibly just want to set margin-top: 0 on the h1.

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

Sidebar

Related Questions

I have a menu working fairly well but can't figure out how to make
Fairly new to programming. I just can't wrap my head around how to get
I know object oriented PHP and Java, and I can code Javascript fairly well
I have a vertical drop-down menu that is working fairly well. I have one
In coredata I can work with one Entity fairly well, mostly because its nicely
my code is fairly well covered with exception handling (try..except). Some exceptions are not
Mobile devices have started to do link detection fairly well. They now detect links,
I'm very much new to programming and have been doing fairly well so far.
I'm using Flash Builder 4.6 to make an iOS app.. It's going fairly well,
I am fairly new to programming with the Play framework as well as Akka,

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.