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

  • Create New...