Site logo

Archived topic

Logo and Navigation centred

7 replies · Started by Ivo on August 25, 2021

Viewing posts 1–8 of 8

Hello
i would like to have a sticky navigation with a centered logo above the navigation. What is the best way to do this?

Thank you for help.
Best regards Ivo

Hi Ivo,

Try this CSS:

#site-navigation {
    margin-top: 202px;
}

#masthead, #site-navigation {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translatex(-50%);
    z-index: 999999;
    width: 100%;
}

Hi Ying,

Thanks you, the sticky header partially covers the header image:

#masthead, #site-navigation {
position: fixed;
top: 0;
left: 50%;
transform: translatex(-50%);
z-index: 999999;
width: 100%;
}

/* Page-Headers margin */
.gb-container-ae74c347 > .gb-inside-container {
margin-top:202px;
}

/* Homepage margin */
.entry-content {
margin-top:202px;
}

Hi there,

few things:

1. remove All that CSS and use this, its Yings original CSS that is applied only to mobile, and includes the home page adjustment:

@media(min-width: 769px) {
    #site-navigation {
        margin-top: 202px;
    }
    
    #masthead, #site-navigation {
        position: fixed;
        top: 0;
        left: 50%;
        transform: translatex(-50%);
        z-index: 999999;
        width: 100%;
    }
    home #page {
        margin-top: 240px; /* Height of header and Navigation */
    }
}

2. Edit your Block Element displayed on your other pages, select the parent container block and add 240px Top margin to the Block. Then select the Mobile Tab, and set that value to 0

Thank you!

You're welcome

This archived topic is closed to new replies.