Jump to content

Custom coding for navigation menu effect

Recommended Posts

Site URL: https://pepper-pelican-gr94.squarespace.com/training

Hi, I would like to add this effect where when you hover over the navigation menu, a different coloured bar appears for each one like on this site: https://museumofvancouver.ca/

 - which I can see is a customised SquareSpace site.

Anyone know how to do this?

PW: ValuesAndFrames

Thanks! Gemma

Edited by CommonCause
url did not appear
Link to comment
  • Replies 7
  • Views 441
  • Created
  • Last Reply

Top Posters In This Topic

On 4/25/2022 at 12:18 PM, CommonCause said:

site PW: ValuesAndFrames

Add to Design > Custom CSS

div.header-nav-item:before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background-color: green;
    border-radius: 10px;
}
div.header-nav-item {
    position: relative;
}
div.header-nav-item:nth-child(2):before {
    background-color: violet;
}
div.header-nav-item:nth-child(3):before {
    background-color: green;
}
div.header-nav-item:nth-child(4):before {
    background-color: red;
}
div.header-nav-item:nth-child(5):before {
    background-color: #f1f;
}
div.header-nav-item:nth-child(6):before {
    background-color: #ececec;
}

 

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 4/27/2022 at 8:12 AM, tuanphan said:

Add to Design > Custom CSS

div.header-nav-item:before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background-color: green;
    border-radius: 10px;
}
div.header-nav-item {
    position: relative;
}
div.header-nav-item:nth-child(2):before {
    background-color: violet;
}
div.header-nav-item:nth-child(3):before {
    background-color: green;
}
div.header-nav-item:nth-child(4):before {
    background-color: red;
}
div.header-nav-item:nth-child(5):before {
    background-color: #f1f;
}
div.header-nav-item:nth-child(6):before {
    background-color: #ececec;
}

 

Thank you, that works and I can see how to change the colours. Is there any way to have the line appear under the navigation items, instead of above them?

Site url: https://pepper-pelican-gr94.squarespace.com/

PW: ValuesAndFrames

Link to comment
On 5/2/2022 at 5:51 PM, CommonCause said:

Thank you, that works and I can see how to change the colours. Is there any way to have the line appear under the navigation items, instead of above them?

Site url: https://pepper-pelican-gr94.squarespace.com/

PW: ValuesAndFrames

change top: 0;

to

bottom: 0;

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.