Removing space at the top left and right of div

后端 未结 9 1902
迷失自我
迷失自我 2020-12-01 13:02

I am starting to work with css and have basic issue.

I have a div element:

9条回答
  •  长情又很酷
    2020-12-01 13:08

    You need to reset both the default padding and margin attributes in your stylesheet:

    html, body {
        margin: 0;
        padding: 0;
    }
    

    As @Jason McCreary mentions, you should also look into using a reset stylesheet. The one he links to, Eric Meyer's CSS reset, is a great place to start.

    It also looks like you're missing a semi-colon in your css, it should look as follows:

    .top
    {
        background-color:#3B5998;
        margin-left:0px;
        margin-top:0px;
    }
    

提交回复
热议问题