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*/


Also from the inspector:


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.

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.

  • Create New...