HTML Element Style How to - Add href linkable area to div on selected area








Question

We would like to know how to add href linkable area to div on selected area.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
#footer {<!--from  www. j  a v a 2  s  . c om-->
  background: #f00;
  width: 500px;
  height: 100px;
}

#footer a.link {
  width: 20px;
  height: 20px;
  border: solid 1px #000;
  float: right;
  margin: 20px;
}
</style>
</head>
<body>
  <div id="footer">
    <a href="#" class="link"></a>
  </div>
</body>
</html>

The code above is rendered as follows: