We would like to know how to hover to change the opacity of div.
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
.navbar-menu {<!-- www. j av a2s. c o m-->
background-color: green;
font-size: 25px;
height: 100px;
margin: 0 auto;
padding: 10px 43px;
width: 150px;
}
.navbar-menu:hover {
opacity: 0.5;
}
</style>
<title>Button</title>
</head>
<body>
<div class="navbar-menu">
<center>HTML/CSS</center>
</div>
</body>
</html>
The code above is rendered as follows: