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

Fixed nav bar problem

Hey everyone, I created a fixed bar in css and it works except when I scroll down all of the other content goes in front of it and not behind. Does anyone know how to fix this? Thanks.

Johnny Martinez
Johnny Martinez
9,849 Points

Sounds like you need to set a z-index on the fixed nav bar. http://css-tricks.com/video-screencasts/40-how-z-index-works/

but like Mike Morales said, if you could post a codepen or jsfiddle it's much easier for others to provide help.

2 Answers

Mike Morales
Mike Morales
19,833 Points

Jeremy - Could you please show us your work using Codepen, or jsFiddle?

Sure, how do I do that? I'm not very familiar with CodePen

James Barnett
James Barnett
39,199 Points
  1. Go to http://codepen.io
  2. Click on the New Pen button
  3. Paste in your HTML, CSS & JavaScript into their respective sections
  4. Paste the of your pen here

If you need more details check out this guide to using codepen