Change position of menu to below header – Yoko theme

  • Unknown's avatar

    Hi there,

    I’m using the Yoko theme and have been trying, using ‘inspect element’ and the css customisation capability to identify the menu code and change it so the menu sits below the header but I am having no luck. When I use the ‘inspect element’ tool on the menu it seems to come up as #branding #mainnav, but when I adjust the css it moves the whole page down, not just the menu.

    Could anyone advise how I need to go about this?

    Many thanks in advance.

    Michaela

    The blog I need help with is: (visible only to logged in users)

  • Please try this CSS and see if you like the result.

    header#branding {
        position: relative;
    }
    
    #branding #mainnav {
        position: absolute;
        top: 150px;
    
    }
    
    #site-title {
        display:none
    }
  • Unknown's avatar

    Thank you – that is working well, however Id still like the menu to be aligned right. When I added left: 500 px it put it in the right position but on the mobile screen it is all out of whack. Is there a way to have it align to right of screen under the header but still function as it should on mobile devices?

    Thanks in advance!

  • Let’s add a media query to make this CSS apply only if the screen size is at least 900px:

    @media screen and (min-width:900px) {
        header#branding {
        position: relative;
    }
    
    #branding #mainnav {
        position: absolute;
        top: 150px;
        left: 500px;
    
    }
    
    #site-title {
        display:none
    }
    }
  • Unknown's avatar

    Thank you – that worked a treat!

  • The topic ‘Change position of menu to below header – Yoko theme’ is closed to new replies.