CSS Layout How to - Overlap text with absolute position








Question

We would like to know how to overlap text with absolute position.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
.testclass {<!--from   www  .j a  va  2s .  co m-->
  width: 40px;
  height: 40px;
  color: #0072bc;
  overflow: hidden;
  position: relative;
}

a.bx-next {
  z-index: 999;
  position: absolute;
  top: 0px;
  left: 0px
}
</style>
</head>
<body>
  <div class="testclass">
    test<a href="#" class="bx-next">next</a>
  </div>
</body>
</html>

The code above is rendered as follows: