如何删除页面顶部的边距

luc*_*n84 3 html css html5 margin css3

我想删除页面顶部的边距.我将通过屏幕截图向您展示我的意思在此输入图像描述

你可以在我的照片中看到一个红色箭头表示我的问题.我怎么能删除这个保证金?我在这里发布我的CSS:

div#header {
    background-color: #6495ED;
    background: -moz-linear-gradient(100% 100% 90deg, black, gray);
    background: -webkit-gradient(linear, center top, center bottom, from(gray), to(black));
    margin: 0px;
    width: 100%;
}
body {
    background-color: #000000;
    width: 100%;
    height: 100%;
    padding: 0;
    margin: 0;
}
h1 {
    text-align: center;
    color: #FFFFFF;
    font-family:  sans-serif;
    font-size: 26px;
    font-weight: bold;
    padding: 5px;
}
ul {
    list-style-type: none;
    padding: 5px;
}

li {
    color: #FFFFFF;
    font-family: sans-serif;
}

p {
    color: #FFFFFF;
    font-family: sans-serif;
    padding: 5px;
}
a {
    text-decoration: none;
    color: #FFFFFF;
}
Run Code Online (Sandbox Code Playgroud)

那么关于如何删除我标题上方的这个边距的任何建议?

在这里你可以看到我的HTML:

<!DOCTYPE html>
<html lang="it">
    <head>
        <meta charset="utf-8" />
        <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/>  
        <title>Lista coupon</title>
        <script src="../js/jquery-1.9.1.min.js" type="text/javascript"></script>
        <script src="../js/memoria.js"          type="text/javascript"></script>
        <style  src="../css/style.css"          type="text/css"></style>
    </head>
    <body onload="loadJson();">
        <div id="header">
            <h1>Lista coupon salvati</h1>
        </div>
        <div id="content">
            <p>Di seguito trovi tutte le promozioni salvate</p>
            <div id="list">
            </div>          
        </div>
        <div id="footer">

        </div>
    </body>
</html>
Run Code Online (Sandbox Code Playgroud)

And*_*ios 7

设置margin: 0;<h1>元素

演示:http://jsfiddle.net/5w6Es/

相同的问题与margin-left<ul>元件,或margin-top/ margin-bottom<p>元件等

在页面边框使用它们时,您需要重置其默认样式.