Click here to Skip to main content
15,884,836 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hey all,

I wanted to change the text of my existing header menu on my site. Is there any way that this can be done so that when you hover over a menu item, the text changes?

I want to make sure that I'll be able to use the existing menu that I have in my header and if possible the existing class for the site nav.

Each menu item would need its own unique text for the hover over.

Thanks all!

What I have tried:

The only code in place within the theme.css for the nav that may be relevant:

.site-nav__link:focus .site-nav__label, .site-nav__link:not([disabled]):hover .site-nav__label {
  border-bottom-color: none !important;
color: #eae5d3}

@media only screen and (max-width: 989px) {
  .site-nav__link--button {
    font-size: calc(var(--font-size-base) * 1px); } }

.site-nav__link--button:focus, .site-nav__link--button:hover {
  color: var(--color-text-focus);
}
Posted
Updated 9-Feb-21 12:45pm

1 solution

Hi,

I would consider adding another HTMLelement automatically (use CSS "after") and have it invisible when not hovered. Then switch both visibilities when hovered. My CSS is a bit rusty, I won't engage in any actual code here.

:)
 
Share this answer
 
Comments
Peter_in_2780 9-Feb-21 22:25pm    
That's wandering into croc-infested territory. Disappearing an item when you hover over it....

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900