Page Widget How to - Align arrows








Question

We would like to know how to align arrows.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
.arrowContainer {<!--from  www.ja v a2  s.c  om-->
  position: relative;
  width: 50px;
  height: 50px;
}

.arrowContainer a {
  text-indent: -9999px;
  display: block;
  width: 0;
  height: 0;
  position: absolute;
}

.top {
  top: 0;
  left: 15px;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 10px solid black;
}

.top:hover {
  border-bottom: 10px solid red;
}

.left {
  top: 15px;
  left: 0;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-right: 10px solid black;
}

.left:hover {
  border-right: 10px solid black;
}

.bottom {
  bottom: 0;
  left: 15px;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 10px solid black;
}

.bottom:hover {
  border-top: 10px solid blue;
}

.right {
  top: 15px;
  right: 0;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-left: 10px solid black;
}

.right:hover {
  border-left: 10px solid pink;
}
</style>
</head>
<body>
  <div style=" z-index: 1;">
    <div class="arrowContainer">
      <a class="left" href="">L</a> 
      <a class="top" href="">U</a> 
      <a class="bottom" href="">D</a>
      <a class="right" href="">R</a>
    </div>
  </div>
</body>
</html>

The code above is rendered as follows: