PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Monday, May 16, 2022

[FIXED] How to I bring my sticky navbar in front of the contents on my page?

 May 16, 2022     css, html, wordpress     No comments   

Issue

I'm using wordpress and bootstrap and I have a a navber that sticks to the top of the page when scrolling, problem is it falls behind some of the contents on the page (see image for reference). How to I get the nabber to always be in front of whatever its scrolls past? Thanks in advance.

enter image description here

HTML:

<nav class="navbar navbar-inverse" data-spy="affix" data-offset-top="91" id="search-nav"></nav>

CSS:

#search-nav {
  height: 50px;
  width: 100%;
  background-color: #000;
}

Solution

You can try to put a value of z-index combined with a defined position (could be fixed, absolute, relative .. ) which is higher than the default z-index value of the below elements.

Source : https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Positioning/Understanding_z_index/Adding_z-index



Answered By - Vincent G
Answer Checked By - Mary Flores (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing