Jump to content

Second button on Nav bar with different color

Recommended Posts

Site URL: https://harp-bullfrog-34ne.squarespace.com

Site password is 2021!

I used the following code to add another button on the Nav bar

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.0/jquery.min.js"></script>
<script>
$(document).ready(function() {
$('.header-actions .header-actions-action.header-actions-action--cta').before('<div class="header-actions-action header-actions-action--cta" id=""> <a class="btn btn--border theme-btn--primary-inverse" href="/join-now" id=""> Book Demo </a> </div>');
$('.header--menu-open .header-menu .header-menu-cta').before('<div class="header-menu-cta " id="" style=" "> <a class="btn btn--border theme-btn--primary-inverse" href="/join-now" id=""> Join Now </a> </div>');
});
</script>

How do i style this button (Book Demo) to have a white border and white text, but keep the style for Sign Up button the same as existing (blue color)? Hover style can stay the same.

 

Link to comment
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.0/jquery.min.js"></script>
<script>
$(document).ready(function() {
$('.header-actions .header-actions-action.header-actions-action--cta').before('<div class="header-actions-action header-actions-action--cta" id=""> <a class="btn btn--border theme-btn--primary-inverse" style="color: white; border: 2px solid white;" href="/join-now" id=""> Book Demo </a> </div>');  
});
</script>

I think this works

Link to comment
16 hours ago, dbliss20 said:

Site URL: https://harp-bullfrog-34ne.squarespace.com

Site password is 2021!

I used the following code to add another button on the Nav bar


<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.0/jquery.min.js"></script>
<script>
$(document).ready(function() {
$('.header-actions .header-actions-action.header-actions-action--cta').before('<div class="header-actions-action header-actions-action--cta" id=""> <a class="btn btn--border theme-btn--primary-inverse" href="/join-now" id=""> Book Demo </a> </div>');
$('.header--menu-open .header-menu .header-menu-cta').before('<div class="header-menu-cta " id="" style=" "> <a class="btn btn--border theme-btn--primary-inverse" href="/join-now" id=""> Join Now </a> </div>');
});
</script>

How do i style this button (Book Demo) to have a white border and white text, but keep the style for Sign Up button the same as existing (blue color)? Hover style can stay the same.

 

your site is private now, did you resolve issue?

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations)
🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates)

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

 

Link to comment
12 hours ago, dbliss20 said:

My site is https://seabass-vuvuzela-ynfj.squarespace.com/

I got the buttons to appear on non-mobile devices. However, on mobile, it doesn't show it. Is there a way i can make it work for mobile?

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.0/jquery.min.js"></script>
<script>
$(document).ready(function() {
$('.header-actions .header-actions-action.header-actions-action--cta').before('<div class="header-actions-action header-actions-action--cta" id=""> <a class="btn btn--border theme-btn--primary-inverse" style="color: white; border: 2px solid white;" href="/join-now" id=""> Book Demo </a> </div>');  
$('.header-menu-nav a.btn').before('<div class="header-actions-action header-actions-action--cta" id=""> <a class="btn btn--border theme-btn--primary-inverse" style="color: white; border: 2px solid white;" href="/join-now" id=""> Book Demo </a> </div>');  
});
</script>
<style>
  @media screen and (max-width:767px) {
  .header-actions-action.header-actions-action--cta {
    display: block !important;
}
    .header-actions-action a.btn {
    color: blue !important;
    border-color: blue !important;
}
  }
</style>

 

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
  • 7 months later...
18 hours ago, abcohen1605 said:

Can I use this button but make it a phone number? 

In above code, edit Book Demo to your phone number, eg: 0123.456.789

& edit this line

href="/join-now"

to

href="tel:0123456789"

with 0123456789 is your phone number

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.