Jump to content

Force button on mobile header

Recommended Posts

Site URL: https://www.valkyriegym.com/

Hi there, code rookie here. Could really use a hand with this one!

I have a Custom CSS in use on my site to force the mobile menu all the time.
I think this is it:

Quote

.header-nav, .header-actions {

  display: none;

}

.header-burger {

  display: flex;

}

.header--menu-open .header-menu {

visibility: visible;

  opacity: 1;

}
a {
text-decoration: none !important;
}



I'm trying to add a button in the gap between the logo and the menu button that says 'Get Started'. I want it so that it is always present on the header; desktop or mobile view.

I've read other forum posts and tried to use the code, but it doesn't work, i assume becasue of the other code I'm using.

Website: https://www.valkyriegym.com/
Link for button: https://www.valkyriegym.com/starthere

 

Screenshot of how i want it to look below.

THANK YOU <3

Screenshot2024-09-17at12_09_02pm.thumb.png.6ea81b363fdcc30349c2bfa043a7de28.png

Link to comment

You can use this code to Custom CSS box

/* Show button next to burger on mobile */
@media screen and (max-width:991px) {
  .header-actions.header-actions--right, .header-actions-action.header-actions-action--cta {
    display: flex !important;
}
.header-title-nav-wrapper {
    flex: 1 0 30% !important;
}
a.btn {
    padding-left: 10px !important;
    padding-right: 10px !important;
    font-size: 14px !important;
}
}

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
On 9/18/2024 at 11:30 PM, tuanphan said:

You can use this code to Custom CSS box

/* Show button next to burger on mobile */
@media screen and (max-width:991px) {
  .header-actions.header-actions--right, .header-actions-action.header-actions-action--cta {
    display: flex !important;
}
.header-title-nav-wrapper {
    flex: 1 0 30% !important;
}
a.btn {
    padding-left: 10px !important;
    padding-right: 10px !important;
    font-size: 14px !important;
}
}

 

Thanks so much @tuanphan, this is perfect on mobile view!

Can you possibly tweak it to work the same on desktop view too please?
Thanks ◡̈

Link to comment
On 9/23/2024 at 6:11 AM, Samfromvalkyrie said:

Thanks so much @tuanphan, this is perfect on mobile view!

Can you possibly tweak it to work the same on desktop view too please?
Thanks ◡̈

You mean force burger + button on desktop? You can change 991px to 3000px

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
On 9/24/2024 at 7:31 PM, tuanphan said:

You mean force burger + button on desktop? You can change 991px to 3000px

hey Yes that's more like it, thank you.
There's a mystery button appearing at the bottom of the mobile menu now though, it seems to be a replication of the button from the top bar (see black button in screenshot)
Any way to get rid of it?

Thanks for your help

Screenshot 2024-09-26 at 12.50.46 PM.png

Link to comment
On 9/26/2024 at 9:52 AM, Samfromvalkyrie said:

hey Yes that's more like it, thank you.
There's a mystery button appearing at the bottom of the mobile menu now though, it seems to be a replication of the button from the top bar (see black button in screenshot)
Any way to get rid of it?

Thanks for your help

Screenshot 2024-09-26 at 12.50.46 PM.png

You can use this to Website Tools > Custom CSS

.header-menu-nav-wrapper a.btn {
	display: none !important;
}

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

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.