Jump to content

Second button on Nav bar with different color

Recommended Posts

Posted

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.

 

  • Replies 7
  • Views 967
  • Created
  • Last Reply
Posted
<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

Posted
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 (Pinch/Zoom images, videos - PDFs Lightbox - ...) </>  🗓️ Delivery Date Picker (Date picker form field)
Gallery block 7.1 workaround </> 🤖 Ask me anything

Posted
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!)

  • 7 months later...
Posted
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!)

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.