Jump to content

How do I add a badge to navigation?

Recommended Posts

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

Hello,

I would like to add a badge that will lead to my SoundBetter page when clicked. Ideally, I would like to have this next to my navigation on top of every page of my site, so potential clients always see it. Alternatively, I could add it to just one page.

I think I'm supposed mot be looking for something called 'Code Block' but I can't seem to find that.

Do I need a Business Account in order do this? And please let me know if you need me to paste the code in this forum.

Thank you!

Link to comment

Add to Home > Design > Custom CSS. Replace with badge image url

a.Header-nav-item[href="/new-page"] {
    background-image: url(https://beaverhero.com/wp-content/uploads/2020/05/ss-team01-min.png);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center center;
    color: transparent !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

Hi again,

Sorry, I don't get it.

This is the code for the badge I want to add.

How does this work with the code you just sent me?

 

<a href="https://soundbetter.com/profiles/249298-paul-bonomo" rel="noopener noreferrer" target="_blank" title="Paul Bonomo profile on SoundBetter" ><img alt="Paul Bonomo, Keyboards - Synth on SoundBetter" src="https://d2p6ecj15pyavq.cloudfront.net/assets/SoundBetterBadge-1bc672131a12c38bd822195fbe5d0e17.svg" style="max-width: 130px;" /></a>

Link to comment

Edit "New page" item in navigation > change link to this: https://soundbetter.com/profiles/249298-paul-bonomo

then edit above code to

a.Header-nav-item[href*="soundbetter"] {
    background-image: url(https://d2p6ecj15pyavq.cloudfront.net/assets/SoundBetterBadge-1bc672131a12c38bd822195fbe5d0e17.svg);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center center;
    color: transparent !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
  • 3 months later...
On 9/24/2020 at 4:08 PM, BerlinGoodMan said:

Hi there,

You asked if I had any other questions, so here goes.

Could you help me with resizing this badge, please? I'd like to make it bigger.

Thanks a lot!

a.Header-nav-item[href*="soundbetter"] {
    background-image: url(https://d2p6ecj15pyavq.cloudfront.net/assets/SoundBetterBadge-1bc672131a12c38bd822195fbe5d0e17.svg);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center center;
    color: transparent !important;
    width: 50px;
    height: 50px;
}

 

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
  • 1 year later...
On 3/3/2022 at 12:08 AM, Nana-nana said:

Hi @tuanphan

I am trying to recreate a sign like this website, check the center of top nav bar with the "new" sign on it.

https://sakura.co/

Can you help me with this? Much appreciated!!

my website: https://travelwithamnet.com/

You mean "New" badge on Sakuraco?

Which items you want to apply on your site?

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 3/9/2022 at 12:13 PM, Nana-nana said:

Yes @tuanphan

The page I want to apply to is not listed on the main nav bar yet.

However, the page itself is already published. 
https://travelwithamnet.com/fci-sample

Thanks in advance as always!! 

Hi @tuanphan,

I changed the slag so I'm just sharing the link below. 

Thanks again!

https://travelwithamnet.com/fly-to-japan-from-home-traditional-and-modern/description

Link to comment
On 3/13/2022 at 12:20 AM, Nana-nana said:

Hi @tuanphan,

I changed the slag so I'm just sharing the link below. 

Thanks again!

https://travelwithamnet.com/fly-to-japan-from-home-traditional-and-modern/description

Which page on header menu do you want to add badge? I don't see sakuraco

This code (Design > Custom CSS) will add a badge to JR Pass

div.header-nav-item:nth-child(2)>a {
    position: relative;
}
div.header-nav-item:nth-child(2)>a:after {
    content: "New";
    position: absolute;
    top: -10px;
    background-color: red;
    color: white;
    font-size: 12px;
    padding-left: 5px;
    padding-right: 5px;
    border-radius: 5px;
}

 

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 3/13/2022 at 9:36 PM, tuanphan said:

Which page on header menu do you want to add badge? I don't see sakuraco

This code (Design > Custom CSS) will add a badge to JR Pass

div.header-nav-item:nth-child(2)>a {
    position: relative;
}
div.header-nav-item:nth-child(2)>a:after {
    content: "New";
    position: absolute;
    top: -10px;
    background-color: red;
    color: white;
    font-size: 12px;
    padding-left: 5px;
    padding-right: 5px;
    border-radius: 5px;
}

 

Thank you so much @tuanphan!!! As always!!

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.