Jump to content

Make a the header button appear on mobile header menu on desktop

Go to solution Solved by tuanphan,

Recommended Posts

  • Replies 4
  • Views 585
  • Created
  • Last Reply

Top Posters In This Topic

@simoal Hi! You can add this code in Website > Pages > Website Tools > Custom CSS

@media screen and (min-width: 1025px) {
.header-display-desktop .header-actions.header-actions--right {
    display: flex !important;
}

.header-display-desktop .header-actions .header-actions-action.header-actions-action--social {
    display: none;
}    
}

After displaying the button on the desktop version, you can add the following custom code to properly align the elements in the header.

@media screen and (min-width: 1025px) {
.header-title-logo::after {
    display: none;
}

#header .header-display-desktop {
    justify-content: space-between !important;
    flex-wrap: wrap;
    align-content: center;
}

#header .header-title-nav-wrapper {
    flex: unset !important;
}

#header .header-layout-branding-center .header-actions {
    width: unset !important;
}

#header .header-actions--right .header-actions-action {
    margin-left: 0 !important;
}
}

Hope that helps.

Edited by Lesum

If my comments were useful, please like or mark my solution as answer so others can scroll to it quickly. 

Sam
Web Developer & Digital Designer

 Did you find my contribution helpful? Buy me a coffee?

Link to comment
On 7/16/2024 at 7:34 PM, Lesum said:

@simoal Hi! You can add this code in Website > Pages > Website Tools > Custom CSS

@media screen and (min-width: 1025px) {
.header-display-desktop .header-actions.header-actions--right {
    display: flex !important;
}

.header-display-desktop .header-actions .header-actions-action.header-actions-action--social {
    display: none;
}    
}

After displaying the button on the desktop version, you can add the following custom code to properly align the elements in the header.

@media screen and (min-width: 1025px) {
.header-title-logo::after {
    display: none;
}

#header .header-display-desktop {
    justify-content: space-between !important;
    flex-wrap: wrap;
    align-content: center;
}

#header .header-title-nav-wrapper {
    flex: unset !important;
}

#header .header-layout-branding-center .header-actions {
    width: unset !important;
}

#header .header-actions--right .header-actions-action {
    margin-left: 0 !important;
}
}

Hope that helps.

Thank you it helped me a lot. But now the Site logo is not in the middle of the header anymore. It is a little bit too far left. Is there any fast code I can use to make it stay in the middle?

 

Link to comment

Create an account or sign in to comment

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

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.