Jump to content

Mobile menu for desktop causing logo to be off centre

Go to solution Solved by SaranyaDesigns,

Recommended Posts

I am using the code below to use a mobile menu on desktop but it is causing my logo to not be centered. Is there a better way to do this?

 

Site: https://ocelot-harmonica-9zfb.squarespace.com/about

Password: password
 

.header-display-mobile .header-burger {
    order: 2 !important;
}

.burger-inner.header-menu-icon-doubleLineHamburger .top-bun {
    height: 1.5px !important;
    transform: translateY(-10px);
}

.burger-inner.header-menu-icon-doubleLineHamburger .patty {
    background-color: #ffffff !important;
    height: 1.5px !important;
    transform: unset !important;
}

.burger-inner.header-menu-icon-doubleLineHamburger .bottom-bun {
    transform: translateY(10px);
    height: 1.5px !important;
}

.header .header-mobile-layout-logo-center-nav-left .header-display-mobile .header-title {
    text-align: unset;
}

.header-burger {
    display: flex;
}

.header-nav {
    display: none !important;
}

.header--menu-open .header-menu {
    opacity: 1;
    visibility: visible;
}

 

Link to comment
  • Replies 5
  • Views 1.2k
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

@collgrimes there's a bunch of ways you could do this... I would probably suggest absolutely positioning the burger menu, but since you're already using flexbox, you can wrap the flexbox and then use a negative top margin on the burger instead. Here's that version:

.header-display-desktop {
	flex-wrap: wrap;
}
.header-title-nav-wrapper {
	flex-basis: 100%;
}
.header-burger {
	flex-basis: 100%;
	justify-content: flex-end;
	margin-top: -46px; /* or whatever the height of your logo is */
}

 

Link to comment

I thought that worked but it was still off a bit. I tried adding this but that didn't work either.

.header-title-logo {
    text-align: right;
}

This is the full code I am using but open to other ways of doing this.

.header-display-mobile .header-burger {
    order: 2 !important;
}

.burger-inner.header-menu-icon-doubleLineHamburger .top-bun {
    height: 1.5px !important;
    transform: translateY(-10px);
}

.burger-inner.header-menu-icon-doubleLineHamburger .patty {
    background-color: #ffffff !important;
    height: 1.5px !important;
    transform: unset !important;
}

.burger-inner.header-menu-icon-doubleLineHamburger .bottom-bun {
    transform: translateY(10px);
    height: 1.5px !important;
}

.header .header-mobile-layout-logo-center-nav-left .header-display-mobile .header-title {
    text-align: unset;
}

.header-burger {
    display: flex;
}

.header-nav {
    display: none !important;
}

.header--menu-open .header-menu {
    opacity: 1;
    visibility: visible;
}

.header-title-logo {
    text-align: center;
}

 

Link to comment
  • Solution

@collgrimes can you put back in the code I suggested so I can have a look at it in action? Some properties might be being overridden - it was working when I tested in the inspector window.

You may need to add in a media query so it doesn't affect the mobile version:

@media (min-width:1025px) {
	.header-display-desktop {
		flex-wrap: wrap;
	}
	.header-title-nav-wrapper {
		flex-basis: 100%;
	}
	.header-burger {
		flex-basis: 100%;
		justify-content: flex-end;
		margin-top: -46px; /* or whatever the height of your logo is */
	}
}

 

Edited by SaranyaDesigns
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.