/    Sign up×
Community /Pin to ProfileBookmark

hover on one element change another css

Why does the opposite not work?
https://codepen.io/raul-rogojan/pen/OJmZebj?editors=1100

to post a comment
CSS

6 Comments(s)

Copy linkTweet thisAlerts:
@cootheadJul 31.2021 — Hi there RaulRogojan,

CSS stands for "Cascading Style Sheet" which means

that it's actions work one way only - [b]downwards[/b]. ;)

[i]coothead[/i]
Copy linkTweet thisAlerts:
@viakgroupAug 03.2021 — If you have two elements in your HTML and you want to: hover over one element and change the style of another element, then these two elements must be directly related-parent element, child element, or sibling element. This means that these two elements must either be inside the other or both must be contained in the same larger element.
Copy linkTweet thisAlerts:
@codyhillauthorAug 03.2021 — @viakgroup#1634991 So what is the problem here?

https://codepen.io/raul-rogojan/pen/poPZLVK
Copy linkTweet thisAlerts:
@cootheadAug 03.2021 — Hi there RaulRogojan,

this...

<i>
</i>.skill:hover ~ skill-number {
color: blue;
}


...should be...

<i>
</i>.skill:hover .skill-number {
color: blue;
}


[i]coothead[/i]
Copy linkTweet thisAlerts:
@codyhillauthorAug 03.2021 — @coothead#1634997 Thank you!
Copy linkTweet thisAlerts:
@cootheadAug 03.2021 — No problem, you're very welcome. ;)

[i]coothead[/i]
×

Success!

Help @codyhill spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.25,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...