Jump to content

Fixed Header and content problem


Recommended Posts

I'm working on a wordpress website and I have a problem.

I have a fixed menu at the top of my website. I added padding-top px to the "content" id. this way my content starts below the header.

The problem I am facing right now is that when I'm using anchor links my content wil start underneath the menu.

Is there a way I can let my content start below the menu without adding extra padding to the top of the content so that when I'm using anchor links this wil start below the menu?

CSS below (text + image):

#header-grid {
    position: fixed;
    width: 100%;
    z-index: 1000; /*Werkt alleen in combinatie met "content" id*/
}
#content {
    padding-top: 65px; /* deze werkt samen met "header-grid" id zodat de "sticky menu" de pagina's niet overlappen heb ik de pagina content 65 pixels naar beneden gezet.*/
}

@media only screen and (max-width: 768px) {
#content {
    padding-top: 57px;
  }/*Deze is heeft dezelfde functie als "content" class alleen dan voor responsive voor tablet/mobiel*/
}

image.png.07fd6c230924d3c1b4a9b85e8274c9d0.png

Also from the inspector:

image.png.30ef7da3ed75568b543494a3cd8b9c73.png

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...