Avatar of Melody Scott
Melody ScottFlag for United States of America

asked on 

Need help with a hover statement in SCSS/CSS

Hi, on http://dev2.magickitchen.com, I have orange down arrows on the main nav.
User generated image
I want that to turn white on hover. The scss code I have for it is:

.site-header .navbar span.glyphicon-menu-down-orange:before {
    content: url(../img/arrow-small-pale-orange.svg);
}

So I was trying:
.site-header .navbar span.glyphicon-menu-down-orange:before {
    content: url(../img/arrow-small-pale-orange.svg);
      
      &:hover {
    content: url(../img/arrow-small-white.svg);
}
}

But that didn't work. I sense I am close though. Can someone help me out? Thanks.

If you need to log onto the page, I've attached the credentials.
credentials.txt
Web DevelopmentCSSHTML* SCSS

Avatar of undefined
Last Comment
Melody Scott
Avatar of Jeffrey Dake
Jeffrey Dake
Flag of United States of America image

There are several options you could do.  First you could change your html, but the easiset might be to use some javascript.  If you could on hover change the css the css completely so that you are still using your same css but without the hover state in the css.

https://www.w3schools.com/jquery/event_hover.asp
Avatar of Melody Scott
Melody Scott
Flag of United States of America image

ASKER

I'd rather not have to use jquery, isn't there just some CSS I could add? What I was trying to do in my example was add a class on hover that changed the color of the arrow. (Actually changes the image).
Avatar of Jeffrey Dake
Jeffrey Dake
Flag of United States of America image

You already try?  I wasn't really thinking but I thought that works

site-header .navbar span.glyphicon-menu-down-orange:hover:before {
    content: url(../img/arrow-small-white.svg);
}

Open in new window


I am pretty sure it works if you put the hover first.
Avatar of Melody Scott
Melody Scott
Flag of United States of America image

ASKER

You're right, that worked! Thanks, I was going about it wrong. But there's something else; look here: https://www.magickitchen.com

The arrow is tied into the word, so if you hover over the word, the arrow changes as well. But it doesn't on the http://dev2.magickitchen.com/.

Any idea why? I'll see if I can figure it out as well.
ASKER CERTIFIED SOLUTION
Avatar of Jeffrey Dake
Jeffrey Dake
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Melody Scott
Melody Scott
Flag of United States of America image

ASKER

Thanks! I am starting from scratch, but pretty sure I'll be using this as I get there.
Web Development
Web Development

Web development includes all aspects of presenting content on intranets and the Internet, including delivery development, protocols, languages and standards, server software, browser clients, databases and multimedia generation.

78K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo