-1

I have a strange problem.

Everything on my page went well, I had my navigation bar ready (also for my mobile phone). Then I put a photo under the navigation bar and the bar was gone ..

I want the bar fixed so that it remains visible, but when I do it is gone.

The picture should remain relative otherwise this will not be correct anymore if you resize to mobile phone.

Someone a solution that keeps the bar back?

Image css

    .header{
      max-width: 100%;
      margin-left: 0;
      margin-top: 0;
      position: relative;
      letter-spacing: 4px;
      margin-top: 70px;
      box-sizing: inherit;
    }
    .header-image{
      max-width: 100%;
      height: auto;  
      border-style: none;
      background-size: cover;
      background-position: center center;
      display: block;
      position: relative;
      box-sizing: inherit;
    }
    .header-image-tekst{
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%,-50%);
      box-sizing: inherit;
      display: block;
      text-align: center!important;
      margin-top: 16px!important;
    }
    .header-image-tekst h1{
      color: white;
      font-size: 38px!important;
      margin: 10% 0;
    }
    .header-image-tekst h1 .border{
      padding: 8px 16px!important;
      background-color: black;
      opacity: 0.75;
    }

Navigation bar css

    .container{
        margin: 0 auto;
        width: 100%;
        position: fixed;
    }

    .nav{
      border-bottom: 1px solid #EAEAE8;
      text-align: right;
      height: 70px;
      line-height: 70px;
      position: fixed;
    }

    .menu{
      margin: 0 30px 0 0;
    }

    .menu a{
      clear: right;
      text-decoration: none;
      color: #000;
      margin: 0 10px;
      line-height: 70px;
      padding: 20px;
      border-radius: 40px;
    }

    .menu a:hover{
      background-color: #03999e3b;
    }
    label{
      margin: 0 40px 0 0;
      float: right;
      margin: 0 10px;
      line-height: 70px;
      font-size: 26px;
      display: none;
      width: 26px;
      float: right;
      
    }

    #toggle{
      display: none;
    }

    @media only screen and (max-width: 700px){
      label{
        display: block;
        cursor: pointer;
        position: fixed;
      }
      .menu{
        text-align: center;
        width: 100%;
        display: none;
      }
      .menu a{
        display: block;
        border-bottom: 1px solid #03989E;
        margin: 0;
      }
      #toggle:checked + .menu {
        display: block;
        position: fixed;
      }
    }

    .active{
      background-image: linear-gradient(315deg, #ffffff 0%, #03989E 74%);
      
    }
dale landry
  • 7,831
  • 2
  • 16
  • 28
SurfDiamer
  • 11
  • 3
  • 1
    Welcome to stack overflow, snippits should be for when you want to parse code that will reproduce an issue. In the future, use tildes ``` or wrap code in the
     tags or use the wizzywig editor `{}` ***codesample*** button.
    – dale landry May 26 '21 at 22:54

1 Answers1

0

From what I can tell, the image is likely over-lapping the navbar. Use z-index on the navigation bar to make it appear on top of the image. If you don't want them overlapping then you'll have to adjust some of your layout CSS but that should work. I'll usually put my z-index for my navigation at 10, that way it'll always be in front of other elements where I have a z-index set.

Here's a reference article: https://developer.mozilla.org/en-US/docs/Web/CSS/z-index

Sam
  • 88
  • 9
  • Thanks @Sam, but i have already tried this. For example, if I put the photo in z-index -10 then my navigation bar appears ON the photo and no longer in the right place (+ the white color is also transparent with the photo) and navigationbar on for example z-index 10 does not help either because you do not see any change .. – SurfDiamer May 27 '21 at 15:01
  • oh and if you prefer a better view. Here is the link of the page I am referring to: https://mijnfietsavontuur.netlify.app/mijn%20routes – SurfDiamer May 27 '21 at 15:04