why there is a White space on the top on html2canvas?

There is a white space on my html2canvas and I am not sure what is going on. This is my code so far.

function doFunction() {

  html2canvas(document.querySelector("#capture"), ).then(canvas => {
    $("body").append(canvas);
  });
}

$("button").click(function() {
  doFunction();
});
div {
  box-sizing: border-box;
  font-family: 'ABeeZee', sans-serif;
}

body {
  background-color: red;
}

#capture {
  width: 900px;
  height: 900px;
  background-color: aqua;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="http://html2canvas.hertzen.com/dist/html2canvas.js"></script>
<div id="capture">
  Hello
</div>
<button type="button">Click Me!</button>

This is the appended canvas. Notice there is a white space on the top. How can I remove it?

enter image description here

34 thoughts on “why there is a White space on the top on html2canvas?”

  1. You actually make it seem so easy along with your presentation however I find
    this matter to be really one thing that I think I might never understand.

    It kind of feels too complex and very wide for me.
    I am taking a look forward to your next publish, I will try to get the cling of
    it!

    Reply
  2. Good day! I know this is kind of off topic but I was
    wondering which blog platform are you using for this
    website? I’m getting sick and tired of WordPress because I’ve
    had issues with hackers and I’m looking at options for another platform.
    I would be fantastic if you could point me in the direction of a good platform.

    Reply
  3. I absolutely love your website.. Great colors & theme.
    Did you develop this website yourself? Please reply back as I’m wanting
    to create my own blog and want to find out where you got this from or what
    the theme is named. Many thanks!

    Reply
  4. I’m really loving the theme/design of your blog.

    Do you ever run into any browser compatibility issues?
    A number of my blog audience have complained about my site
    not operating correctly in Explorer but looks great in Firefox.
    Do you have any ideas to help fix this problem?

    Reply
  5. Does your site have a contact page? I’m having a
    tough time locating it but, I’d like to send
    you an e-mail. I’ve got some recommendations for your blog you might be
    interested in hearing. Either way, great website
    and I look forward to seeing it grow over time.

    Reply
  6. Its like you read my mind! You seem to know a lot about this, like you wrote the book in it or something.
    I think that you could do with a few pics to drive the message home a little bit, but other than that, this is
    fantastic blog. A great read. I’ll certainly be back.

    Reply
  7. Hi there! I realize this is sort of off-topic but I needed to ask.

    Does running a well-established website such as yours require a massive
    amount work? I am completely new to blogging however I do write
    in my diary daily. I’d like to start a blog so I can share my own experience and thoughts online.
    Please let me know if you have any ideas or tips for new aspiring bloggers.
    Thankyou! quest bars http://bit.ly/3jZgEA2 quest bars

    Reply
  8. 150206 37304Empathetic for your monstrous inspect, in addition Im just seriously good as an alternative to Zune, and consequently optimism them, together with the quite excellent critical reviews some other players have documented, will let you determine whether it does not take appropriate choice for you. 547916

    Reply

Leave a Comment