CSS - 无法摆脱保证金

Don*_*uma 1 html css

我的问题是我有一个标题,假设占据整个页面的顶部,但由于某种原因,双方都有一个余量.

我的Css:

#top_bar{
    background-color:#000;
    height: 80px;
    left: 0px;
    right: 0px;
    margin-left: 0px;
    margin-right: 0px;
    position: relative;
    top: -10px;
    width: 100%;
    color:#FFF;
}
Run Code Online (Sandbox Code Playgroud)

phi*_*hag 6

最有可能的是,这源于身体的默认边距/填充.尝试添加

html,body {padding:0; margin:0;}
Run Code Online (Sandbox Code Playgroud)