Jump to content

Fixed Header and content problem


Cryptomain
 Share

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 comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...