Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

Doegena Fennich
Doegena Fennich
8,974 Points

HTML&CSS navigation issue

Hey, I was currently testing my knowledge of HTML and CSS but the thing i still dont fully understand is how to make the background color of the <nav> the same height as the <ul> here's an example of my problem:

http://jsbin.com/canakukani/edit?html,css,output (view it on fullscreen)

as you can see there is a little gap between the ul and nav, i already tried margin- bottom with a negative number but for some reason nothing happens. I would appreciate it if someone can explain the problem,

Hey,

I have adjusted the ul element bottom margin to -3px - and it removed the black space. Did you try it on the ul element?

ul {
  display: inline-block;
  list-style: none;
  margin: 0 0 -3px 0;
  padding: 0;
  overflow: hidden;
}

Works also on full-screen.

1 Answer

Doegena Fennich
Doegena Fennich
8,974 Points

Thanks German Iakovlev, it worked. Completely forgot about the ul margin.