/    Sign up×
Community /Pin to ProfileBookmark

Hover effect on ::after elements

Hi !
I have and ::after on a button

[code].overlay button::after {
content: ”;
display: block;
height: 3px;
width: 100%;
background-color: #000;
}[/code]

And I want to make it change colors on hover and I don’t know how .
So far I tried this and a few other method.

[code].overlay button:hover {
color: #fff;
}
.overlay button::after:hover {
color: #fff;
}[/code]

to post a comment
CSS

4 Comments(s)

Copy linkTweet thisAlerts:
@SempervivumJun 03.2019 — color affects the text and there is no text inside the
::after (content:'';)
This works for me:
.overlay button:hover::after {
background-color: blue;
}
Copy linkTweet thisAlerts:
@codyhillauthorJun 03.2019 — @Sempervivum#1604296 got it , I should have tough of that
Copy linkTweet thisAlerts:
@siddhi_patelJun 07.2019 — Hey... this is work for me :

.overlay button:hover::after

{

content: '';

color:#blue;

background-color: #white;

}
Copy linkTweet thisAlerts:
@cootheadJun 07.2019 — > @siddhi_patel#1604423

> **[color=#069]Hey... this is work for me [/color]**


I think that you that you somehow made a mistake

when you plagiarised @Sempervivum#1604296's post.

There is certainly no way that this...


``<i>
</i> color:#blue;
background-color: #white;<i>
</i>
``


...can work.

_coothead_
×

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,
)...