HTML Element Style How to - Hover to change the opacity of div


We would like to know how to hover to change the opacity of div.


<!DOCTYPE html>
<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;
  <div class="navbar-menu">

The code above is rendered as follows: