/    Sign up×
Community /Pin to ProfileBookmark

Hover ~ does not work

Hi, I am trying to add opacity to am img when I hover on another using this element ~. But for some reason doesn’t;t work.
Any idea?
https://codepen.io/raul-rogojan/pen/QWjbrej?editors=1100

to post a comment
CSS

6 Comments(s)

Copy linkTweet thisAlerts:
@ib_mintApr 13.2020 — @RaulRogojan#1617364

Have a look at this solution: [https://repl.it/repls/FlawedBleakMathematics](https://repl.it/repls/FlawedBleakMathematics)
Copy linkTweet thisAlerts:
@cootheadApr 13.2020 — Hi there @RaulRogojan,

for any chance of it working, the thumb images need to

precede the large images as CSS only works downwards,

hence, CSS - **cascading** style sheet. ;)

**Further reading:-**

[url=https://developer.mozilla.org/en-US/docs/Web/CSS/General_sibling_combinator][color=#069][u]**MDN** - General sibling combinator[/u][/color][/url]

You can view a working example here...

https://codepen.io/coothead/full/ZEbGPow

...and the amended code here...

https://codepen.io/coothead/pen/ZEbGPow

I hope that you are not going to use those enormous

images in any final production. I notice that they vary

in size from over **2MB** to over **4MB**.

_coothead_
Copy linkTweet thisAlerts:
@codyhillauthorApr 13.2020 — @coothead#1617373 thx, no I remember using this operator ~ a while ago in a similar situation and I did not know why wasn't working here. This is just a quick example I came up with.
Copy linkTweet thisAlerts:
@codyhillauthorApr 13.2020 — @coothead#1617373 I wanted to do something similar but haveing more img but won't work without JS. It's for a Wordpress site where I don't have the option of writing js
Copy linkTweet thisAlerts:
@cootheadApr 13.2020 — > @RaulRogojan#1617375

> [color=#069]**I wanted to do something similar but having

> more img but won't work without JS.**
[/color]


Why do you say that?

_coothead_
Copy linkTweet thisAlerts:
@codyhillauthorApr 14.2020 — @coothead#1617376

nvm look like it works.
×

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 5.12,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

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