felix001
felix001

Reputation: 16691

Fixed Nav Issue

Im trying to create a stick nav. However on doing so, the nav goes into the background.

I've set the position on the nav div like so,

.site-header {
    ...
    position: fixed;
}

However, this has worked as expected, as mentioned above. Is there anything else I should be adding, to ensure the div is ontop and fixed.

https://jsfiddle.net/fe6jc8nu/

Thanks,

Upvotes: 0

Views: 38

Answers (1)

marcelo2605
marcelo2605

Reputation: 2794

Add z:index: 9; to .site-header rule:

.site-header {
  background-color: #fff;
  padding-bottom: 25px;
  padding-top: 25px;
  box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
  position: fixed;
  z-index: 9;
}

Upvotes: 1

Related Questions