jacobtohahn jacobtohahn - 19 days ago 7
CSS Question

HTML nav bar will not touch the top of the page

I have been working on making a horizontal navigation bar for my site, but the top of the nav bar seems to be cut off and will not touch the top of the page.

I have tried using:

* {
padding: 0;
margin: 0;
}


However, that causes me to have to add padding to everything.

Is there any other way to fix it?

Fiddle: https://jsfiddle.net/bp2jnytc/

Answer

For your <h3> elements within your unordered lists, you could try:

h3 {
  margin: 0;
  padding: 15px;
}

And then for your <ul> element within your <header>:

header ul {
  margin: 0;
}