Orkun Oz Orkun Oz - 5 months ago 12
CSS Question

Navbar doesn't fit to top

I'm stuck with positioning.

body{
margin: 0;
padding: 0;
font-family: 'Consolas';
letter-spacing: 2px
}

.navbar {
background-color: #595959;
color: #ffffff;
list-style: none;
text-align: center;
padding: 20px 0 20px 0;
}


SS

As you can see, even I set
margin/padding
to 0. it doesn't fit to top. ( I mean this grey line above the navbar.)

Answer

Guessing that your navbar is done with ul/li you need to reset the padding from ul

so set padding:0 to ul

Comments