Reputation: 41
When I put unordered list
body {
margin: 0;
padding: 0;
}
.top-bar {
height: 40px;
width: 100%;
background-color: yellow;
}
#menu {
width: 1020px;
height: : 100%;
margin: 0 auto;
background-color: red;
}
ul {
background-color: red;
width: 100%;
height: 40px;
}
<body>
<div class="top-bar">
<div id="menu">
<ul>
<li>Menu1</li>
</ul>
</div>
</div>
</body>
Upvotes: 0
Views: 135
Reputation: 15951
use this for removing padding
and margin
which is given by browsers
*{
margin:0;
padding:0;
}
you will get more information on reset css here
here are the list of css styles used to reset
Upvotes: 2
Reputation: 1033
The ul element has margin-top by default from browser. To remove that, add the style
ul {
margin-top: 0;
}
Upvotes: 2