HTML Element Style How to - Hover to change div element background


We would like to know how to hover to change div element background.


<!DOCTYPE html>
<style type='text/css'>
.main-banner a#link1 {<!-- w ww.  j  av  a 2 s. c  o m-->
  background: red;
  display: block;
  width: 310px;
  height: 85px;
  top: 190.2px;
  left: 277px;

.main-banner a#link1:hover {
  background: green;
  <div class="main-banner">
    <a href="#" id="link1">d</a>

The code above is rendered as follows: