CSS Margin: 0 is not setting to 0

前端 未结 11 1611
名媛妹妹
名媛妹妹 2020-12-06 09:13

I\'m a new comer to web designing. I created my web page layout using CSS and HTML as below. The problem is even though i set the margin to 0, the upper margin is not settin

11条回答
  •  感动是毒
    2020-12-06 09:52

    You need to set the actual page to margin:0 and padding: 0 to the actual html, not just the body.

    use this in your css stylesheet.

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

    that will set the whole page to 0, for a fresh clean start with no margin or paddings.

提交回复
热议问题