Remove HTML canvas border

后端 未结 2 954
隐瞒了意图╮
隐瞒了意图╮ 2021-01-15 17:58

I\'m customising my homepage http://geotheory.co.uk/ with an interactive animation, but having trouble making it feel more seemeless in the page. I want to remove the animat

相关标签:
2条回答
  • 2021-01-15 18:26

    Add margin: 0; to the body tag in your css, and display: block; to the canvas tag in your css.

    Example:

    canvas {
        display:block;
    }
    
    body {
        margin:0;
    }
    
    0 讨论(0)
  • 2021-01-15 18:48

    I guess you've not resetted the browser default styles...So you need to reset the default styles.. Use this

    * {
       margin: 0;
       padding: 0;
    }
    

    Explanation : Browser gives padding, margins to some elements, so inorder to reset them you need to use the style which I told you else you can also use CSS reset

    And also use display: block; for <canvas> (As Kolink Said)

    0 讨论(0)
提交回复
热议问题