CSS Background hover opacity

Hi there,

I am trying to give a link’s background color a lighter colour when on hover.

I’ve tried this, but it’s not working.

Have I got something wrong?

.tooltip-info .links a.energy{
	background: #00d07a;
}
.tooltip-info .links a.energy:after{
	  transition: opacity 1s ease;
}
.tooltip-info .links a.energy:hover:after {
    opacity: 0.5;
}

Can anyone see what I have wrong?

Hi there toolman,

does this help…

<!DOCTYPE HTML>
<html lang="en">
<head>

<meta charset="utf-8">
<meta name="viewport" content="width=device-width,height=device-height,initial-scale=1">

<title>untitled document</title>

<!--<link rel="stylesheet" href="screen.css" media="screen">-->

<style media="screen">
body {
    background-color: #f9f9f9;
    font: normal 1em / 1.5em BlinkMacSystemFont, -apple-system, 'Segoe UI', roboto, helvetica, arial, sans-serif;
 }

.energy {
    display: inline-block;
    padding: 1em;
    background-color: rgba( 0, 208, 122, 1 );
    color: #000;
    transition: background-color 1s ease;
    text-transform: uppercase;
 }

.energy:hover,
.energy:active {
    background-color: rgba( 0, 208, 122, 0.5 );
 }

</style>

</head>
<body> 

 <a class="energy" href="#">test rgba</a>


</body>
</html>

coothead

1 Like

Thank you coothead, that worked great :smiley:

 
 
        No problem, you’re very welcome. :winky:
 
 
        coothead

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.