I have a simple html page with some style in it and I do not understand why the adds some top margin?
Here is the source:
as per this question Browsers' default CSS stylesheets
add *{margin:0; padding:0;}
which will remove default margin
and padding
given by browsers
or you can also use reset.css
* {
margin: 0;
padding: 0;
}
body {
margin: 0;
padding: 0;
background-color: #ffffcc;
}
#content {
width: 900px;
margin-left: auto;
margin-right: auto;
border: 0;
background-color: #ccccff;
}
<div id="content">
<div>
<ul>
<li><a href="./xxx.html">xxx</a>
</li>
<li><a href="./yyy.html">yyy</a>
</li>
<li><a href="./zzzz.html">zzz</a>
</li>
</ul>
</div>
</div>
It should be a user agent stylesheet. Your browser puts that margin on every <ul>
element.
Check here stackoverflow
Also you can check here