Page Widget How to - Create Arrow Tab Menu








Question

We would like to know how to create Arrow Tab Menu.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
.arrow {<!--from w w  w  .  j a v  a 2 s .co  m-->
  position: relative;
  color: #fff;
}

.red-gradient {
  height: 20px;
  padding: 10px;
  width: 200px;
  background: -moz-linear-gradient(top, #c40320 0%, #8f0222 44%, #6d0019 100%);
  background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #c40320),color-stop(44%, #8f0222), color-stop(100%, #6d0019));
  background: -webkit-linear-gradient(top, #c40320 0%, #8f0222 44%, #6d0019 100%);
  background: -o-linear-gradient(top, #c40320 0%, #8f0222 44%, #6d0019 100%);
  background: -ms-linear-gradient(top, #c40320 0%, #8f0222 44%, #6d0019 100%);
  background: linear-gradient(to bottom, #c40320 0%, #8f0222 44%, #6d0019 100%);
}

.red {
  height: 20px;
  padding: 10px;
  width: 160px;
  color: #fff;
  background: #8f0222;
}
#arrow1:after {
  content: '';
  height: 0;
  display: block;
  border-color: #fff #fff #fff transparent;
  border-width: 20px;
  border-style: solid;
  position: absolute;
  top: 0;
  left: 180px;
}

#arrow2:after {
  content: '';
  height: 0;
  display: block;
  border-color: transparent transparent transparent #8f0222;
  border-width: 20px;
  border-style: solid;
  position: absolute;
  top: 0;
  left: 180px;
}
</style>
</head>
<body>
  <div id="arrow1" class="arrow">
    <div class="red-gradient">gradient</div>
  </div>
  <div id="arrow2" class="arrow">
    <div class="red">no gradient</div>
  </div>
</body>
</html>

The code above is rendered as follows: